summaryrefslogtreecommitdiff
path: root/Git
diff options
context:
space:
mode:
Diffstat (limited to 'Git')
-rw-r--r--Git/Branch.hs17
1 files changed, 13 insertions, 4 deletions
diff --git a/Git/Branch.hs b/Git/Branch.hs
index a0c15d171..6258939cb 100644
--- a/Git/Branch.hs
+++ b/Git/Branch.hs
@@ -100,7 +100,7 @@ fastForward branch (first:rest) repo =
where
no_ff = return False
do_ff to = do
- update branch to repo
+ update' branch to repo
return True
findbest c [] = return $ Just c
findbest c (r:rs)
@@ -155,7 +155,7 @@ commit commitmode allowempty message branch parentrefs repo = do
ifM (cancommit tree)
( do
sha <- commitTree commitmode message parentrefs tree repo
- update branch sha repo
+ update' branch sha repo
return $ Just sha
, return Nothing
)
@@ -185,8 +185,17 @@ forcePush :: String -> String
forcePush b = "+" ++ b
{- Updates a branch (or other ref) to a new Sha. -}
-update :: Branch -> Sha -> Repo -> IO ()
-update branch sha = run
+update :: String -> Branch -> Sha -> Repo -> IO ()
+update message branch sha = run
+ [ Param "update-ref"
+ , Param "-m"
+ , Param message
+ , Param $ fromRef branch
+ , Param $ fromRef sha
+ ]
+
+update' :: Branch -> Sha -> Repo -> IO ()
+update' branch sha = run
[ Param "update-ref"
, Param $ fromRef branch
, Param $ fromRef sha