Skip to content

Commit

Permalink
push: Correctly initialize nonfastforward in transport_push.
Browse files Browse the repository at this point in the history
The variable is assigned unconditionally in print_push_status, but
print_push_status is not reached by all codepaths. In particular, this
fixes a bug where "git push ... nonexisting-branch" was complaining about
non-fast forward.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Matthieu Moy authored and Junio C Hamano committed Sep 20, 2009
1 parent cb57220 commit bb8cccd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,9 @@ int transport_set_option(struct transport *transport,

int transport_push(struct transport *transport,
int refspec_nr, const char **refspec, int flags,
int * nonfastforward)
int *nonfastforward)
{
*nonfastforward = 0;
verify_remote_names(refspec_nr, refspec);

if (transport->push)
Expand Down

0 comments on commit bb8cccd

Please sign in to comment.