Git: isRepo

Signed-off-by: Félix Sipma <felix.sipma@no-log.org>
This commit is contained in:
Félix Sipma 2014-11-17 20:23:30 +01:00 committed by Joey Hess
parent 0847118cc4
commit f3beea212c
1 changed files with 3 additions and 0 deletions

View File

@ -91,3 +91,6 @@ cloned owner url dir mbranch = check originurl (property desc checkout)
-- installed here.
, Just "git update-server-info"
]
isRepo :: FilePath -> IO Bool
isRepo dir = isNothing <$> catchMaybeIO (readProcess "git" ["rev-parse", "--resolve-git-dir", dir])