2014-04-17 22:41:24 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
2018-12-09 18:10:37 +00:00
|
|
|
- Copyright 2014-2018 Joey Hess <id@joeyh.name>
|
2014-04-17 22:41:24 +00:00
|
|
|
-
|
2019-03-13 19:48:14 +00:00
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
2014-04-17 22:41:24 +00:00
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.FindRef where
|
|
|
|
|
|
|
|
import Command
|
|
|
|
import qualified Command.Find as Find
|
2017-08-31 16:47:08 +00:00
|
|
|
import qualified Git
|
2014-04-17 22:41:24 +00:00
|
|
|
|
2015-07-08 16:33:27 +00:00
|
|
|
cmd :: Command
|
support findred and --branch with file matching options
* findref: Support file matching options: --include, --exclude,
--want-get, --want-drop, --largerthan, --smallerthan, --accessedwithin
* Commands supporting --branch now apply file matching options --include,
--exclude, --want-get, --want-drop to filenames from the branch.
Previously, combining --branch with those would fail to match anything.
* add, import, findref: Support --time-limit.
This commit was sponsored by Jake Vosloo on Patreon.
2018-12-09 17:38:35 +00:00
|
|
|
cmd = withGlobalOptions [annexedMatchingOptions] $ Find.mkCommand $
|
2015-07-08 19:08:02 +00:00
|
|
|
command "findref" SectionPlumbing
|
2018-12-09 18:10:37 +00:00
|
|
|
"lists files in a git ref (deprecated)"
|
2015-07-11 00:38:11 +00:00
|
|
|
paramRef (seek <$$> Find.optParser)
|
2014-04-17 22:41:24 +00:00
|
|
|
|
2015-07-11 00:38:11 +00:00
|
|
|
seek :: Find.FindOptions -> CommandSeek
|
2018-12-09 18:10:37 +00:00
|
|
|
seek o = Find.seek o'
|
|
|
|
where
|
|
|
|
o' = o
|
|
|
|
{ Find.keyOptions = Just $ WantBranchKeys $
|
2020-04-07 21:41:09 +00:00
|
|
|
map (Git.Ref . encodeBS') (Find.findThese o)
|
2018-12-09 18:10:37 +00:00
|
|
|
, Find.findThese = []
|
|
|
|
}
|