From 9d167ac2e64fc3f791ac2695e7a65a70446c80ea Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Feb 2018 12:55:20 -0400 Subject: cleanup debug --- src/Propellor/DotDir.hs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/Propellor/DotDir.hs') diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index be5d614d..125cec3f 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -392,12 +392,10 @@ checkRepoUpToDate = whenM (gitbundleavail <&&> dotpropellorpopulated) $ do updateUpstreamMaster :: String -> IO () updateUpstreamMaster newref = do changeWorkingDirectory =<< dotPropellor - v <- getoldrev - case v of - Nothing -> return () - Just oldref -> go oldref + go =<< getoldref where - go oldref = do + go Nothing = return () + go (Just oldref) = do let tmprepo = ".git/propellordisttmp" let cleantmprepo = void $ catchMaybeIO $ removeDirectoryRecursive tmprepo cleantmprepo @@ -428,11 +426,10 @@ updateUpstreamMaster newref = do -- Get ref that the upstreambranch points to, only when -- the distrepo is being used. - getoldrev = do - mrev <- catchMaybeIO $ takeWhile (/= '\n') + getoldref = do + mref <- catchMaybeIO $ takeWhile (/= '\n') <$> readProcess "git" ["show-ref", upstreambranch, "--hash"] - print mrev - case mrev of + case mref of Just _ -> do -- Normally there will be no upstream -- remote when the distrepo is used. @@ -442,13 +439,12 @@ updateUpstreamMaster newref = do ifM (hasRemote "upstream") ( do v <- remoteUrl "upstream" - print ("remote url", v) return $ case v of - Just rurl | rurl == distrepo -> mrev + Just rurl | rurl == distrepo -> mref _ -> Nothing - , return mrev + , return mref ) - Nothing -> return mrev + Nothing -> return mref -- And, if there's a remote named "upstream" -- that does not point at the distrepo, the user must have set that up -- cgit v1.2.3