diff options
Diffstat (limited to 'src/Propellor/Git.hs')
| -rw-r--r-- | src/Propellor/Git.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Propellor/Git.hs b/src/Propellor/Git.hs index 1d81c157..10b88ddd 100644 --- a/src/Propellor/Git.hs +++ b/src/Propellor/Git.hs @@ -23,9 +23,12 @@ getCurrentGitSha1 branchref = takeWhile (/= '\n') <$> readProcess "git" ["show-ref", "--hash", branchref] hasOrigin :: IO Bool -hasOrigin = catchDefaultIO False $ do +hasOrigin = hasRemote "origin" + +hasRemote :: String -> IO Bool +hasRemote remotename = catchDefaultIO False $ do rs <- lines <$> readProcess "git" ["remote"] - return $ "origin" `elem` rs + return $ remotename `elem` rs hasGitRepo :: IO Bool hasGitRepo = doesFileExist ".git/HEAD" |
