diff options
| author | Joey Hess <joey@kitenet.net> | 2014-08-19 17:09:11 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-08-19 17:09:11 -0400 |
| commit | f72a1aa690704b352fa3914514d04438fd0718c0 (patch) | |
| tree | b5147e4536be452e9c4b4e99eb2becbc4abb22df | |
| parent | 371f6077fdc86e1af5c0e9f2ff4d3ee03b9a1e8c (diff) | |
fixes
| -rw-r--r-- | src/wrapper.hs | 10 |
1 files changed, 7 insertions, 3 deletions
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)) $ |
