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.)
This commit is contained in:
parent
be03afac67
commit
097605e2e9
2 changed files with 15 additions and 10 deletions
|
@ -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 })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue