From 2db8167ddbfa080b44509d4532d7d34887cdc64a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Jun 2021 13:28:25 -0400 Subject: merge from git-annex Fixes 2 bugs, one a data loss bug. It is possible to get those fixes without merging all the other changes, if a backport is wanted. --- Git/CurrentRepo.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Git/CurrentRepo.hs') diff --git a/Git/CurrentRepo.hs b/Git/CurrentRepo.hs index 25bdc5c..9261eab 100644 --- a/Git/CurrentRepo.hs +++ b/Git/CurrentRepo.hs @@ -10,6 +10,7 @@ module Git.CurrentRepo where import Common +import Git import Git.Types import Git.Construct import qualified Git.Config @@ -46,12 +47,12 @@ get = do wt <- maybe (worktree (location r)) Just <$> getpathenvprefix "GIT_WORK_TREE" prefix case wt of - Nothing -> return r + Nothing -> relPath r Just d -> do curr <- R.getCurrentDirectory unless (d `dirContains` curr) $ setCurrentDirectory (fromRawFilePath d) - return $ addworktree wt r + relPath $ addworktree wt r where getpathenv s = do v <- getEnv s -- cgit v1.2.3