aboutsummaryrefslogtreecommitdiff
path: root/Git/CheckIgnore.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-09 13:35:02 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-09 13:37:06 -0400
commite5ae5bd15965be6919165fb04644b17754e296f8 (patch)
tree0c1bef20f89fa7c6fd0a0c511f60716a872b8d71 /Git/CheckIgnore.hs
parentf1c44f9fad9c10059df99d644a62332629af89cf (diff)
This fixes a bug in the assistant introduced by the literal pathspec changes in version 5.20150406.
git-checkignore refuses to work if any pathspec options are set. Urgh. I audited the rest of git, and no other commands used by git-annex have such limitations. Indeed, AFAICS, *all* other commands support --literal-pathspecs. So, worked around this where git-checkignore is called.
Diffstat (limited to 'Git/CheckIgnore.hs')
-rw-r--r--Git/CheckIgnore.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Git/CheckIgnore.hs b/Git/CheckIgnore.hs
index 5fa3cb637..a03f45432 100644
--- a/Git/CheckIgnore.hs
+++ b/Git/CheckIgnore.hs
@@ -31,10 +31,13 @@ type CheckIgnoreHandle = CoProcess.CoProcessHandle
-
- The first version of git to support what we need is 1.8.4.
- Nothing is returned if an older git is installed.
+ -
+ - check-ignore does not support --literal-pathspecs, so remove that
+ - from the gitGlobalOpts if set.
-}
checkIgnoreStart :: Repo -> IO (Maybe CheckIgnoreHandle)
checkIgnoreStart repo = ifM supportedGitVersion
- ( Just <$> (CoProcess.rawMode =<< gitCoProcessStart True params repo)
+ ( Just <$> (CoProcess.rawMode =<< gitCoProcessStart True params repo')
, return Nothing
)
where
@@ -42,6 +45,9 @@ checkIgnoreStart repo = ifM supportedGitVersion
[ Param "check-ignore"
, Params "-z --stdin --verbose --non-matching"
]
+ repo' = repo { gitGlobalOpts = filter (not . pathspecs) (gitGlobalOpts repo) }
+ pathspecs (Param "--literal-pathspecs") = True
+ pathspecs _ = False
supportedGitVersion :: IO Bool
supportedGitVersion = do