push: Correctly initialize nonfastforward in transport_push.
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>
Matthieu Moy committed
Sep 20, 2009 at 19:33 UTC
bb8cccd01762d26c832b85d3b09798650e294c5f
1 file changed
+2
-1
transport.c
+2
-1
@@ -1001,8 +1001,9 @@ int transport_set_option(struct transport *transport,
1001
1002
int transport_push(struct transport *transport,
1003
int refspec_nr, const char **refspec, int flags,
1004
- int * nonfastforward)
1004
+ int *nonfastforward)
1005
{
1006
+ *nonfastforward = 0;
1007
verify_remote_names(refspec_nr, refspec);
1008
1009
if (transport->push)