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

[PATCH 0/2] Fix a bug with update-ref "verify" and no oldvalue

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Dec 10, 2014, 23:47 UTC
Message-ID
<1418255272-5875-1-git-send-email-mhagger@alum.mit.edu>
Ever since the --stdin option was added to "git update-ref" in
    c750ba9519 update-ref: support multiple simultaneous updates (2013-09-09)

the "verify" command has been broken. If no <oldvalue> is specified, the documentation says that the "verify" command will verify that the reference doesn't currently exist. But in fact, it unconditionally *deletes* the reference (!)

Hopefully this is not a common usage idiom, but this is nonetheless a serious bug.

Add some tests for this and related functionality, then fix the bug.

These patches are also available from my GitHub repository [1] as branch "update-ref-verify-fix-v1".

This fix applies to "maint", for which I think it is appropriate. It also merges through to "master" with no conflicts, though it conflicts trivially with "pu".

[1] https://github.com/mhagger/git
Michael Haggerty (2):
  t1400: add some more tests of "update-ref --stdin"'s verify command
  update-ref: fix "verify" command with missing <oldvalue>
 builtin/update-ref.c  | 14 +++-----
 t/t1400-update-ref.sh | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 97 insertions(+), 9 deletions(-)
-- 
2.1.3
Next: Michael Haggerty
Message 1 of 7 in “Fix a bug with update-ref "verify" and no oldvalue”
  1. 0/2 Fix a bug with update-ref "verify" and no oldvalueMichael Haggerty, Dec 10, 2014
  2. 1/2 t1400: add some more tests of "update-ref --stdin"'s verify commandMichael Haggerty, Dec 10, 2014
  3. Stefan BellerDec 11, 2014
  4. Brad KingDec 11, 2014
  5. 2/2 update-ref: fix "verify" command with missing <oldvalue>Michael Haggerty, Dec 10, 2014
  6. Stefan BellerDec 11, 2014
  7. Brad KingDec 11, 2014

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.