diff options
| author | Joey Hess <joeyh@joeyh.name> | 2018-02-22 11:41:57 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2018-02-22 11:41:57 -0400 |
| commit | 530d9ff6bea5570d051d07546a128d456b3c5c3b (patch) | |
| tree | 0d7d4b390f874780561b037c0a6c34964d8f5298 /src/Propellor | |
| parent | 8a3310d5420024454b54ff019afcaaa40a9803f7 (diff) | |
Avoid crashing if initial fetch from origin fails when spinning a host.
Diffstat (limited to 'src/Propellor')
| -rw-r--r-- | src/Propellor/Git/VerifiedBranch.hs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Propellor/Git/VerifiedBranch.hs b/src/Propellor/Git/VerifiedBranch.hs index 51fcb573..df607bd2 100644 --- a/src/Propellor/Git/VerifiedBranch.hs +++ b/src/Propellor/Git/VerifiedBranch.hs @@ -30,12 +30,17 @@ verifyOriginBranch originbranch = do -- Returns True if HEAD is changed by fetching and merging from origin. fetchOrigin :: IO Bool fetchOrigin = do + fetched <- actionMessage "Pull from central git repository" $ + boolSystem "git" [Param "fetch"] + if fetched + then mergeOrigin + else return False + +mergeOrigin :: IO Bool +mergeOrigin = do branchref <- getCurrentBranch let originbranch = "origin" </> branchref - void $ actionMessage "Pull from central git repository" $ - boolSystem "git" [Param "fetch"] - oldsha <- getCurrentGitSha1 branchref keyring <- privDataKeyring |
