summaryrefslogtreecommitdiff
path: root/src/wrapper.hs
diff options
context:
space:
mode:
authorJoey Hess2016-04-01 18:36:38 -0400
committerJoey Hess2016-04-01 18:36:38 -0400
commitccfdfcab60753eb6eb6ab1c6a6ad6203b8adfdcf (patch)
tree7cfb29ca5214b24d837518a104a28df785c7ca6d /src/wrapper.hs
parent503437b676f5c4d41ef41c6de3e3b25045bcc5d7 (diff)
fix false positive for out of date message after initial clone from git bundle
Diffstat (limited to 'src/wrapper.hs')
-rw-r--r--src/wrapper.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/wrapper.hs b/src/wrapper.hs
index f079eb32..82251dc9 100644
--- a/src/wrapper.hs
+++ b/src/wrapper.hs
@@ -12,6 +12,7 @@ module Main where
import Propellor.Message
import Propellor.Bootstrap
+import Propellor.Git
import Utility.UserInfo
import Utility.Monad
import Utility.Process
@@ -225,10 +226,12 @@ checkRepoUpToDate dotpropellor = whenM (gitbundleavail <&&> dotpropellorpopulate
if (headknown == Nothing)
then setupUpstreamMaster headrev dotpropellor
else do
- merged <- not . null <$>
- readProcess "git" ["log", headrev ++ "..HEAD", "--ancestry-path"]
- unless merged $
- warnoutofdate dotpropellor True
+ theirhead <- getCurrentGitSha1 =<< getCurrentBranchRef
+ when (theirhead /= headrev) $ do
+ merged <- not . null <$>
+ readProcess "git" ["log", headrev ++ "..HEAD", "--ancestry-path"]
+ unless merged $
+ warnoutofdate dotpropellor True
where
gitbundleavail = doesFileExist disthead
dotpropellorpopulated = doesFileExist (dotpropellor </> "propellor.cabal")