{"thread":{"id":"20973","subject":"[PATCH] push: Correctly initialize nonfastforward in do_push.","startedAt":"2009-09-16T16:37:00Z","lastAt":"2009-09-16T17:13:57Z","messageCount":2,"participants":["Matthieu Moy","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"123357","messageId":"1253119020-26547-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"20973","inReplyTo":null,"subject":"[PATCH] push: Correctly initialize nonfastforward in do_push.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-09-16T16:37:00Z","receivedAt":"2009-09-16T16:37:00Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The variable is assigned unconditionally in print_push_status, but\nprint_push_status is not reached by all codepaths. In particular, this\nfixes a bug where \"git push ... nonexisting-branch\" was complaining about\nnon-fast forward.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n(I'm the one to blame, sorry for introducing this bug)\n\n builtin-push.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-push.c b/builtin-push.c\nindex 3cb1ee4..a73333b 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -140,7 +140,7 @@ static int do_push(const char *repo, int flags)\n \t\tstruct transport *transport =\n \t\t\ttransport_get(remote, url[i]);\n \t\tint err;\n-\t\tint nonfastforward;\n+\t\tint nonfastforward = 0;\n \t\tif (receivepack)\n \t\t\ttransport_set_option(transport,\n \t\t\t\t\t     TRANS_OPT_RECEIVEPACK, receivepack);\n-- \n1.6.5.rc1.11.g2d184.dirty\n"},{"id":"123361","messageId":"7vpr9q24oa.fsf@alter.siamese.dyndns.org","threadId":"20973","inReplyTo":"1253119020-26547-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] push: Correctly initialize nonfastforward in do_push.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-09-16T17:13:57Z","receivedAt":"2009-09-16T17:13:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> The variable is assigned unconditionally in print_push_status, but\n> print_push_status is not reached by all codepaths. In particular, this\n> fixes a bug where \"git push ... nonexisting-branch\" was complaining about\n> non-fast forward.\n\nHmm, the patch looks correct but I am scratching my head to see how this\nis triggered.  \"git push ... nonexisting-branch\" seems to get:\n\n\terror: src refspec nonexisting-branch does not match any.\n        error: failed to push some refs to '...'\n"}]}