summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Git.hs3
-rw-r--r--src/Propellor/Server.hs4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Propellor/Git.hs b/src/Propellor/Git.hs
index e5f464c0..ccf97b94 100644
--- a/src/Propellor/Git.hs
+++ b/src/Propellor/Git.hs
@@ -42,6 +42,9 @@ hasOrigin = catchDefaultIO False $ do
rs <- lines <$> readProcess "git" ["remote"]
return $ "origin" `elem` rs
+hasGitRepo :: IO Bool
+hasGitRepo = doesFileExist ".git/HEAD"
+
{- To verify origin branch commit's signature, have to convince gpg
- to use our keyring.
- While running git log. Which has no way to pass options to gpg.
diff --git a/src/Propellor/Server.hs b/src/Propellor/Server.hs
index 05a8856d..bf3ba3f9 100644
--- a/src/Propellor/Server.hs
+++ b/src/Propellor/Server.hs
@@ -31,7 +31,7 @@ import Utility.SafeCommand
-- running the updateServer
update :: Maybe HostName -> IO ()
update forhost = do
- whenM hasOrigin $
+ whenM hasGitRep $
req NeedRepoUrl repoUrlMarker setRepoUrl
makePrivDataDir
@@ -39,7 +39,7 @@ update forhost = do
req NeedPrivData privDataMarker $
writeFileProtected privfile
- whenM hasOrigin $
+ whenM hasGitRepo $
req NeedGitPush gitPushMarker $ \_ -> do
hin <- dup stdInput
hout <- dup stdOutput