From adc4e56b4e745bf93b17537a777f60e3113a878c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 4 Jan 2018 14:48:26 -0400 Subject: skip update warning when there's a remote named "upstream" --- src/Propellor/Git.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Git.hs') 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" -- cgit v1.2.3