diff options
Diffstat (limited to 'git-union-merge.hs')
-rw-r--r-- | git-union-merge.hs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/git-union-merge.hs b/git-union-merge.hs index 6fd19c8da..e439c4665 100644 --- a/git-union-merge.hs +++ b/git-union-merge.hs @@ -28,9 +28,7 @@ setup :: Git.Repo -> IO () setup = cleanup -- idempotency cleanup :: Git.Repo -> IO () -cleanup g = do - e' <- doesFileExist (tmpIndex g) - when e' $ removeFile (tmpIndex g) +cleanup g = whenM (doesFileExist $ tmpIndex g) $ removeFile $ tmpIndex g parseArgs :: IO [String] parseArgs = do @@ -43,7 +41,7 @@ main :: IO () main = do [aref, bref, newref] <- map Git.Ref <$> parseArgs g <- Git.Config.read =<< Git.Construct.fromCwd - _ <- Git.Index.override (tmpIndex g) + _ <- Git.Index.override $ tmpIndex g setup g Git.UnionMerge.merge aref bref g _ <- Git.Branch.commit "union merge" newref [aref, bref] g |