summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Backend.hs1
-rw-r--r--Git/LsFiles.hs8
-rw-r--r--Seek.hs4
3 files changed, 8 insertions, 5 deletions
diff --git a/Backend.hs b/Backend.hs
index 50c89ecc5..4c28f1c77 100644
--- a/Backend.hs
+++ b/Backend.hs
@@ -19,7 +19,6 @@ import System.Posix.Files
import Common.Annex
import qualified Git.Config
-import qualified Git.CheckAttr
import qualified Annex
import Annex.CheckAttr
import Types.Key
diff --git a/Git/LsFiles.hs b/Git/LsFiles.hs
index 0de86383d..201d76d1d 100644
--- a/Git/LsFiles.hs
+++ b/Git/LsFiles.hs
@@ -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
diff --git a/Seek.hs b/Seek.hs
index a9c034d22..7f5506316 100644
--- a/Seek.hs
+++ b/Seek.hs
@@ -58,10 +58,8 @@ withFilesUnlockedToBeCommitted = withFilesUnlocked' LsFiles.typeChangedStaged
withFilesUnlocked' :: ([FilePath] -> Git.Repo -> IO [FilePath]) -> (FilePath -> CommandStart) -> CommandSeek
withFilesUnlocked' typechanged a params = do
-- unlocked files have changed type from a symlink to a regular file
- top <- fromRepo Git.workTree
typechangedfiles <- seekHelper typechanged params
- let unlockedfiles = liftIO $ filterM notSymlink $
- map (\f -> top ++ "/" ++ f) typechangedfiles
+ let unlockedfiles = liftIO $ filterM notSymlink typechangedfiles
prepFiltered a unlockedfiles
withKeys :: (Key -> CommandStart) -> CommandSeek