summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2014-08-19 17:09:11 -0400
committerJoey Hess2014-08-19 17:09:11 -0400
commitf72a1aa690704b352fa3914514d04438fd0718c0 (patch)
treeb5147e4536be452e9c4b4e99eb2becbc4abb22df /src
parent371f6077fdc86e1af5c0e9f2ff4d3ee03b9a1e8c (diff)
fixes
Diffstat (limited to 'src')
-rw-r--r--src/wrapper.hs10
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)) $