From ccfdfcab60753eb6eb6ab1c6a6ad6203b8adfdcf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 1 Apr 2016 18:36:38 -0400 Subject: fix false positive for out of date message after initial clone from git bundle --- src/wrapper.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') 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") -- cgit v1.3-2-g0d8e