avoid chdir when already inside worktree

This commit is contained in:
Joey Hess 2012-05-19 10:37:28 -04:00
parent 0093a456e8
commit 9d98144776

View file

@ -35,6 +35,8 @@ get = do
case wt of case wt of
Nothing -> return r Nothing -> return r
Just d -> do Just d -> do
cwd <- getCurrentDirectory
unless (d `dirContains` cwd) $
changeWorkingDirectory d changeWorkingDirectory d
return $ addworktree wt r return $ addworktree wt r
where where