From 58da8089e614ad73b8e2b69a701b2cea620af56b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 22 May 2016 14:58:04 -0400 Subject: git's handing of relative GIT_INDEX_FILE is more insane than I thought; always make absolute This is actually worse than I thought; when git is being run with a detached work tree, GIT_INDEX_FILE is treated as a path relative to CWD, instead of the normal behavior of relative the top of the work tree. This seems to make it basically impossible for any program that wants to use GIT_INDEX_FILE to use anything other than an absolute path to it; there are too many configurations to keep straight that can change how git interprets what should be a simple relative path to a file. (I have complained to the git developers.) --- Annex/GitOverlay.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Annex') diff --git a/Annex/GitOverlay.hs b/Annex/GitOverlay.hs index 2eae5e7fe..2193b7449 100644 --- a/Annex/GitOverlay.hs +++ b/Annex/GitOverlay.hs @@ -19,7 +19,7 @@ import qualified Annex {- Runs an action using a different git index file. -} withIndexFile :: FilePath -> Annex a -> Annex a withIndexFile f a = do - f' <- inRepo $ indexEnvVal f + f' <- liftIO $ indexEnvVal f withAltRepo (\g -> addGitEnv g indexEnv f') (\g g' -> g' { gitEnv = gitEnv g }) -- cgit v1.2.3