summaryrefslogtreecommitdiff
path: root/Git/Config.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-11-30 14:30:56 -0400
committerJoey Hess <joey@kitenet.net>2013-11-30 14:30:56 -0400
commit3c7357ee388795149e922d344bdbf32e1d1d5810 (patch)
treecb7aca4ffb6d9dd63b37ca11fa36c4b94ddb8815 /Git/Config.hs
parentfb9fa44ea545c4ede11c778153f1a3d4bbd573b5 (diff)
downloadgit-repair-3c7357ee388795149e922d344bdbf32e1d1d5810.tar.gz
merge from git-annex
Diffstat (limited to 'Git/Config.hs')
-rw-r--r--Git/Config.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Git/Config.hs b/Git/Config.hs
index 1919ece..b5c1be0 100644
--- a/Git/Config.hs
+++ b/Git/Config.hs
@@ -110,8 +110,13 @@ store s repo = do
-}
updateLocation :: Repo -> IO Repo
updateLocation r@(Repo { location = LocalUnknown d })
- | isBare r = updateLocation' r $ Local d Nothing
- | otherwise = updateLocation' r $ Local (d </> ".git") (Just d)
+ | isBare r = ifM (doesDirectoryExist dotgit)
+ ( updateLocation' r $ Local dotgit Nothing
+ , updateLocation' r $ Local d Nothing
+ )
+ | otherwise = updateLocation' r $ Local dotgit (Just d)
+ where
+ dotgit = (d </> ".git")
updateLocation r@(Repo { location = l@(Local {}) }) = updateLocation' r l
updateLocation r = return r