aboutsummaryrefslogtreecommitdiff
path: root/Command/FindRef.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-04-17 18:41:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-04-17 18:41:24 -0400
commite23a4eb3c9e9a6bc39a5a59fe45300e8fdfb0916 (patch)
treed3a75a3f65edb6f8a02b7ce54553e3a9960fcc34 /Command/FindRef.hs
parente9b6c350b15a93d82affadfabca18b3e95840cb1 (diff)
findref: New command, like find but shows files in a specified git ref.
Diffstat (limited to 'Command/FindRef.hs')
-rw-r--r--Command/FindRef.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/Command/FindRef.hs b/Command/FindRef.hs
new file mode 100644
index 000000000..26007f7c0
--- /dev/null
+++ b/Command/FindRef.hs
@@ -0,0 +1,20 @@
+{- git-annex command
+ -
+ - Copyright 2014 Joey Hess <joey@kitenet.net>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+module Command.FindRef where
+
+import Command
+import qualified Command.Find as Find
+
+def :: [Command]
+def = [Find.mkCommand $ command "findref" paramRef seek SectionPlumbing
+ "lists files in a git ref"]
+
+seek :: CommandSeek
+seek refs = do
+ format <- Find.getFormat
+ Find.start format `withFilesInRefs` refs