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

Re: [PATCH 2/3] push: fail early with detached HEAD and current

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
May 29, 2013, 20:04 UTC
Message-ID
<CALkWK0=W3B0wFSjwa5qrtyOGHyJFWnZQicqubpyvT6hS5EYXpQ@mail.gmail.com>
In-Reply-To
<7v7gihsgjr.fsf@alter.siamese.dyndns.org>
Here: put this at the end of the series and autosquash.
-- 8< --
From: Ramkumar Ramachandra <artagnon@gmail.com>
Date: Thu, 30 May 2013 01:29:59 +0530
Subject: [PATCH] fixup! HEAD~2
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 builtin/push.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/builtin/push.c b/builtin/push.c
index d819487..2d84d10 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -175,7 +175,7 @@ static void
warn_unspecified_push_default_configuration(void)

 static void setup_default_push_refspecs(struct remote *remote)
 {
-       struct branch *branch = branch_get(NULL);
+       struct branch *branch;

        switch (push_default) {
        default:
@@ -196,6 +196,7 @@ static void setup_default_push_refspecs(struct
remote *remote)
                break;

        case PUSH_DEFAULT_CURRENT:
+               branch = branch_get(NULL);
                if (!branch)
                        die(_(message_detached_head_die), remote->name);
                add_refspec(branch->name);
-- 
1.8.3.12.gbd56588
Previous: Junio C HamanoNext: Ramkumar Ramachandra
Message 7 of 8 in “Early HEAD resolution in push.default = current”
  1. 0/3 Early HEAD resolution in push.default = currentRamkumar Ramachandra, May 29, 2013
  2. 1/3 push: factor out the detached HEAD error messageRamkumar Ramachandra, May 29, 2013
  3. 2/3 push: fail early with detached HEAD and currentRamkumar Ramachandra, May 29, 2013
  4. Junio C HamanoMay 29, 2013
  5. Ramkumar RamachandraMay 29, 2013
  6. Junio C HamanoMay 29, 2013
  7. Ramkumar RamachandraMay 29, 2013
  8. 3/3 push: make push.default = current use resolved HEADRamkumar Ramachandra, May 29, 2013

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.