fix LsFiles.typeChanged paths

Passing absolute paths to Command.Add used to work, but after recent
changes doesn't. All LsFiles should use relative paths anyway, so fix it
there.
This commit is contained in:
Joey Hess 2012-02-14 00:22:42 -04:00
parent cbaebf538a
commit a2f241d503
3 changed files with 8 additions and 5 deletions

View file

@ -65,7 +65,13 @@ typeChanged :: [FilePath] -> Repo -> IO [FilePath]
typeChanged = typeChanged' []
typeChanged' :: [CommandParam] -> [FilePath] -> Repo -> IO [FilePath]
typeChanged' ps l = pipeNullSplit $ prefix ++ ps ++ suffix
typeChanged' ps l repo = do
fs <- pipeNullSplit (prefix ++ ps ++ suffix) repo
-- git diff returns filenames relative to the top of the git repo;
-- convert to filenames relative to the cwd, like git ls-files.
let top = workTree repo
cwd <- getCurrentDirectory
return $ map (\f -> relPathDirToFile cwd $ top </> f) fs
where
prefix = [Params "diff --name-only --diff-filter=T -z"]
suffix = Param "--" : map File l