aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2009-09-20 19:33:20 +0200
committerJunio C Hamano <gitster@pobox.com>2009-09-20 12:11:29 -0700
commitbb8cccd01762d26c832b85d3b09798650e294c5f (patch)
tree364585792b070a305d72eb6dcb4d5ddc9fb68c55
parentcb572206d9dac4ba52878e7e1a4a7028d85707ab (diff)
downloadgit-bb8cccd01762d26c832b85d3b09798650e294c5f.tar.gz
git-bb8cccd01762d26c832b85d3b09798650e294c5f.tar.xz
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>
-rw-r--r--transport.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/transport.c b/transport.c
index f231b355f..ce1d25e46 100644
--- a/transport.c
+++ b/transport.c
@@ -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)