git-annex/CmdLine
Joey Hess 34db79e1a5
Bugfix: Passing a command a filename that does not exist sometimes did not display an error, when a path to a directory was also passed.
It was relying on segmentPaths to work correctly, so when it didn't,
sometimes the file that did not exist got matched up with a non-null
list of results. Fixed by always checking if each parameter exists.

There are two reason segmentPaths might not work correctly.

For one, it assumes that when the original list of paths
has more than 100 paths, it's not worth paying the CPU cost to
preserve input orders.

And then, it fails when a directory such as "." or ".." or
/path/to/repo is in the input list, and the list of found paths
does not start with that same thing. It should probably not be using
dirContains, but something else.

But, it's not clear how to handle this fully. Consider
when [".", "subdir"] has been expanded by git ls-files to
["subdir/1", "subdir/2"]
-- Both of the inputs contained those results, so there's
no one right answer for segmentPaths. All these would be equally valid:
	[["subdir/1", "subdir/2"], []]
	[[], ["subdir/1", "subdir/2"]]
	[["subdir/1"], [""subdir/2"]]

So I've not tried to improve segmentPaths.
2017-03-02 13:06:20 -04:00
..
GitAnnex securehash matching 2017-02-27 15:02:44 -04:00
GitAnnexShell Avoid backtraces on expected failures when built with ghc 8; only use backtraces for unexpected errors. 2016-11-15 21:29:54 -04:00
Action.hs Avoid backtraces on expected failures when built with ghc 8; only use backtraces for unexpected errors. 2016-11-15 21:29:54 -04:00
Batch.hs Always use filesystem encoding for all file and handle reads and writes. 2016-12-24 14:46:31 -04:00
GitAnnex.hs post-recive hook to make updateInstead work in direct mode and adjusted branches 2017-02-17 14:04:43 -04:00
GitAnnexShell.hs Avoid backtraces on expected failures when built with ghc 8; only use backtraces for unexpected errors. 2016-11-15 21:29:54 -04:00
GitRemoteTorAnnex.hs convert P2P runners from Maybe to Either String 2016-12-08 15:47:49 -04:00
GlobalSetter.hs mapM_ = sequence_ . map 2017-02-27 14:48:07 -04:00
Option.hs remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00
Seek.hs Bugfix: Passing a command a filename that does not exist sometimes did not display an error, when a path to a directory was also passed. 2017-03-02 13:06:20 -04:00
Usage.hs reinject: Added new mode which can reinject known files into the annex. 2016-04-22 13:49:32 -04:00