summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2014-08-19 17:09:54 -0400
committerJoey Hess2014-08-19 17:09:54 -0400
commit16c33945e29a3d9fdd908ada0dbb63eda9ba44fa (patch)
treec76e4ed1a45dfb403efb7082324159183a49cf01
parentb938dbbe3cb5b6d24406cdfc632c9358906398ad (diff)
parentf72a1aa690704b352fa3914514d04438fd0718c0 (diff)
Merge branch 'joeyconfig'
-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)) $