Created
June 22, 2010 15:58
-
-
Save sbryant/448664 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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
Hi,
I tried this patch, however it still does not work properly, since the ref-branch is "" when pushing repo,
it becomes "push --no-pager push -v origin", and git complains:
fatal: remote part of refspec is not a valid name in
I changed your code a little bit as follows:
substitute "" with branch, which works. Since I am still newbie of git,
I don't know if this change breaks things though.
Cheers,
Binjo