From 9d9814477601217c8d39d75cc03e27ee4d734de3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 19 May 2012 10:37:28 -0400 Subject: avoid chdir when already inside worktree --- Git/CurrentRepo.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Git') diff --git a/Git/CurrentRepo.hs b/Git/CurrentRepo.hs index 746904caf..a40b412f5 100644 --- a/Git/CurrentRepo.hs +++ b/Git/CurrentRepo.hs @@ -35,7 +35,9 @@ get = do case wt of Nothing -> return r Just d -> do - changeWorkingDirectory d + cwd <- getCurrentDirectory + unless (d `dirContains` cwd) $ + changeWorkingDirectory d return $ addworktree wt r where pathenv s = do -- cgit v1.2.3