summaryrefslogtreecommitdiff
path: root/Git
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-03-27 16:45:50 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-03-27 16:45:50 -0400
commit8383afb1ec6a493fb7d3ca302be356ecc59dbc45 (patch)
treec4c9037c111f9d3fbd33d25d91270117700e8538 /Git
parent65d91fe543b6adaa9ba6b6b0f77cf0050864962c (diff)
Prevent git-ls-files from double-expanding wildcards when an unexpanded wildcard is passed to a git-annex command like add or find.
Note that previously, `git annex find *.jpg` would find eg, foo/bar.jpg. That was never intended or documented behavior, so I'm going to change it. But this is potentially a behavior change if someone discovered that behavior and relied on it despite it being accidental. Oh well.. can't make an omlette w/o breaking some eggs.
Diffstat (limited to 'Git')
-rw-r--r--Git/LsFiles.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Git/LsFiles.hs b/Git/LsFiles.hs
index 1006be808..3f001f513 100644
--- a/Git/LsFiles.hs
+++ b/Git/LsFiles.hs
@@ -41,7 +41,7 @@ mkFile :: FilePath -> CommandParam
mkFile = File . concatMap go
where
go c
- | c == '*' = ['\\', c]
+ | c `elem` "*?[]" = ['\\', c]
| otherwise = [c]
{- Scans for files that are checked into git at the specified locations. -}