diff options
author | Joey Hess <joey@kitenet.net> | 2012-05-19 10:37:28 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-05-19 10:37:28 -0400 |
commit | 9d9814477601217c8d39d75cc03e27ee4d734de3 (patch) | |
tree | 9a167c54d0d0108dcfb0bac22050d03372a5d20d /Git | |
parent | 0093a456e869b5250735ef4ec790faac115d9142 (diff) |
avoid chdir when already inside worktree
Diffstat (limited to 'Git')
-rw-r--r-- | Git/CurrentRepo.hs | 4 |
1 files changed, 3 insertions, 1 deletions
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 |