From f72a1aa690704b352fa3914514d04438fd0718c0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 19 Aug 2014 17:09:11 -0400 Subject: fixes --- src/wrapper.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/wrapper.hs b/src/wrapper.hs index c7241991..d3d8f773 100644 --- a/src/wrapper.hs +++ b/src/wrapper.hs @@ -112,12 +112,13 @@ wrapper args propellordir propellorbin = do setupupstreammaster :: String -> FilePath -> IO () setupupstreammaster newref propellordir = do changeWorkingDirectory propellordir - go =<< catchMaybeIO (readProcess "git" ["show-ref", upstreambranch, "--hash"]) + go =<< catchMaybeIO getoldrev where go Nothing = warnoutofdate False go (Just oldref) = do let tmprepo = ".git/propellordisttmp" - removeDirectoryRecursive tmprepo + let cleantmprepo = void $ catchMaybeIO $ removeDirectoryRecursive tmprepo + cleantmprepo git ["clone", "--quiet", ".", tmprepo] changeWorkingDirectory tmprepo @@ -127,8 +128,11 @@ setupupstreammaster newref propellordir = do git ["commit", "-a", "-m", "merging upstream changes", "--quiet"] fetchUpstreamBranch propellordir tmprepo - removeDirectoryRecursive tmprepo + cleantmprepo warnoutofdate True + + getoldrev = takeWhile (/= '\n') + <$> readProcess "git" ["show-ref", upstreambranch, "--hash"] git = run "git" run cmd ps = unlessM (boolSystem cmd (map Param ps)) $ -- cgit v1.2.3