git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] push: Correctly initialize nonfastforward in do_push.

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Sep 16, 2009, 17:28 UTC
Message-ID
<1253122107-31378-1-git-send-email-Matthieu.Moy@imag.fr>
In-Reply-To
<vpqfxamby33.fsf@bauges.imag.fr>

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>
---
New version initializing nonfastforward inside transport()
 transport.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/transport.c b/transport.c
index 4cb8077..18db3d3 100644
--- a/transport.c
+++ b/transport.c
@@ -871,6 +871,7 @@ int transport_push(struct transport *transport,
 		   int refspec_nr, const char **refspec, int flags,
 		   int * nonfastforward)
 {
+	*nonfastforward = 0;
 	verify_remote_names(refspec_nr, refspec);
 
 	if (transport->push)
-- 
1.6.5.rc1.11.g2d184.dirty
Previous: Matthieu MoyNext: Junio C Hamano
Message 2 of 4 in “Re: [PATCH] push: Correctly initialize nonfastforward in do_push.”
  1. Matthieu MoySep 16, 2009
  2. push: Correctly initialize nonfastforward in do_push.Matthieu Moy, Sep 16, 2009
  3. Junio C HamanoSep 16, 2009
  4. Matthieu MoySep 16, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.