Skip to content

Instantly share code, notes, and snippets.

@sbryant
Created June 22, 2010 15:58
Show Gist options
  • Save sbryant/448664 to your computer and use it in GitHub Desktop.
Save sbryant/448664 to your computer and use it in GitHub Desktop.
ccommit 42ee3d2b74ac93a760d7f7479e5fa066bacc15ba
Author: Sean Bryant <sean@vitrue.com>
Date: Tue Jun 22 11:54:50 2010 -0400
make pushing to explicit ref merge branch only push explicitly when it is available
Modified magit.el
diff --git a/magit.el b/magit.el
index 0de0bfc..f8b5aee 100644
--- a/magit.el
+++ b/magit.el
@@ -3041,11 +3041,14 @@ typing and automatically refreshes the status buffer."
(magit-read-remote (format "Push %s to" branch)
branch-remote)
branch-remote))
- (ref-branch (magit-get "branch" branch "merge")))
+ (merge-branch (magit-get "branch" branch "merge"))
+ (ref-branch (if merge-branch
+ (format "%s:%s" branch merge-branch)
+ branch)))
(if (and (not branch-remote)
(not current-prefix-arg))
(magit-set push-remote "branch" branch "remote"))
- (magit-run-git-async "push" "-v" push-remote (format "%s:%s" branch ref-branch))))
+ (magit-run-git-async "push" "-v" push-remote ref-branch)))
;;; Log edit mode
@sbryant
Copy link
Author

sbryant commented Jun 25, 2010

That's probably for the better, I'll update the patch and regenerate the diff for submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment