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

Re: [PATCH] receive: denyCurrentBranch=updateinstead should not blindly update

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Oct 19, 2018, 05:54 UTC
Message-ID
<CAPig+cT9vKDr2uYVS0XdM=KxN5JY4yrONni5iZnVL5GdE1taLw@mail.gmail.com>
In-Reply-To
<xmqqpnw61qkg.fsf_-_@gitster-ct.c.googlers.com>
On Fri, Oct 19, 2018 at 12:57 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> The handling of receive.denyCurrentBranch=updateInstead was added to
> a switch statement that handles other values of the variable, but
> all the other case arms only checked a condition to reject the
> attempted push, or let later logic in the same function to still
> intervene, so that a push that does not fast-forward (which is
> checked after the switch statement in question) is still rejected.
>
> But the handling of updateInstead incorrectly took immediate effect,
> without giving other checks a chance to intervene.
>
> Instead of calling update_worktree() that causes the side effect
> immediately, just note the fact that we will need to call the
> funciton later, and first give other checks chance to reject the

s/funciton/function s/chance/a &/

Show 6 quoted lines
> request.  After the update-hook gets a chance to reject the push
> (which happens as the last step in a series of checks), call
> update_worktree() when we earlier detected the need to.
>
> Reported-by: Rajesh Madamanchi
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Previous: Junio C HamanoNext: Johannes Schindelin
Message 5 of 6 in “receive.denyCurrentBranch=updateInstead updates working tree even when receive.denyNonFastForwards rejects push”
  1. Rajesh MadamanchiOct 16, 2018
  2. Junio C HamanoOct 19, 2018
  3. Junio C HamanoOct 19, 2018
  4. receive: denyCurrentBranch=updateinstead should not blindly updateJunio C Hamano, Oct 19, 2018
  5. Eric SunshineOct 19, 2018
  6. Johannes SchindelinOct 22, 2018

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.