unify handling of unusual GIT_INDEX_FILE relative path

This is probably a git bug that stuck in its interface.
This commit is contained in:
Joey Hess 2016-05-17 14:40:53 -04:00
parent e81b1bc9e7
commit 766728c8cf
Failed to extract signature
4 changed files with 17 additions and 10 deletions

View file

@ -19,10 +19,9 @@ import qualified Annex
{- Runs an action using a different git index file. -}
withIndexFile :: FilePath -> Annex a -> Annex a
withIndexFile f a = do
-- Workaround http://thread.gmane.org/gmane.comp.version-control.git/294880
absf <- liftIO $ absPath f
f' <- inRepo $ indexEnvVal f
withAltRepo
(\g -> addGitEnv g indexEnv absf)
(\g -> addGitEnv g indexEnv f')
(\g g' -> g' { gitEnv = gitEnv g })
a