Skip to content

Commit 8247166

Browse files
avargitster
authored andcommitted
push: change needlessly ambiguous example in error
Change an example push added in b55e677 ("push: introduce new push.default mode "simple"", 2012-04-24) to always mean the same thing whether the current setting happens to be "simple" or not. This error is only emitted under "simple", but message is explaining to the user that they can get two sorts of different behaviors by these two invocations. Let's use "git push <remote> HEAD" which always means push the current branch name to that remote, instead of "git push <remote> <current-branch-name>" which will do that under "simple", but is not guaranteed to do under "upstream". Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d166e6a commit 8247166

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/push.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ static NORETURN int die_push_simple(struct branch *branch, struct remote *remote
173173
"\n"
174174
"To push to the branch of the same name on the remote, use\n"
175175
"\n"
176-
" git push %s %s\n"
176+
" git push %s HEAD\n"
177177
"%s"),
178178
remote->name, short_upstream,
179-
remote->name, branch->name, advice_maybe);
179+
remote->name, advice_maybe);
180180
}
181181

182182
static const char message_detached_head_die[] =

0 commit comments

Comments
 (0)