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

Re: git update-ref fails to create reference. (bug)

From
Rafael Ascensão <rafa.almas@gmail.com>
Date
May 5, 2018, 19:08 UTC
Message-ID
<CACUQV5-9PagVhE5YY=Z3721YRiBwSZykT3ZjtzmD3o-c6O6ddQ@mail.gmail.com>
In-Reply-To
<20180504182646.7738-1-martin.agren@gmail.com>
Thanks Martin for the quick fix.
On Fri, May 04, 2018 at 08:26:46PM +0200, Martin �gren wrote:
Show 5 quoted lines
> Anyway, that's not where I'm stuck... Regardless of how I try to write
> tests (in t1400), they just pass beautifully even before this patch. I
> might be able to look into that more on the weekend. If anyone has
> ideas, I am all ears. Or if someone feels like picking this up and
> running with it, feel free.

In t1400 `m=refs/heads/master` is used in the majority of tests. And this issue doesn't manifest itself if refs are being written under refs/

It also seems particular about having the "old sha" set to 40 zeros or the empty string.

So I guess we should add some extra tests to cover the variations of these two cases.

e.g.
     test_expect_success "create PSEUDOREF" '
         git update-ref PSEUDOREF $A
0000000000000000000000000000000000000000 &&
         test $A = $(cat .git/PSEUDOREF)
     '
fails/succeeds appropriately in my limited testing.

I am busy this weekend, but can try to write some if no one writes it until after the weekend.

Cumprimentos, Rafael Ascensão

Previous: Martin ÅgrenNext: Martin Ågren
Message 3 of 11 in “git update-ref fails to create reference. (bug)”
  1. Rafael AscensãoMay 4, 2018
  2. Martin ÅgrenMay 4, 2018
  3. Rafael AscensãoMay 5, 2018
  4. refs: handle null-oid for pseudorefsMartin Ågren, May 6, 2018
  5. David TurnerMay 6, 2018
  6. Michael HaggertyMay 7, 2018
  7. Martin ÅgrenMay 7, 2018
  8. 0/3 refs: handle zero oid for pseudorefsMartin Ågren, May 10, 2018
  9. 1/3 refs.c: refer to "object ID", not "sha1", in error messagesMartin Ågren, May 10, 2018
  10. 2/3 t1400: add tests around adding/deleting pseudorefsMartin Ågren, May 10, 2018
  11. 3/3 refs: handle zero oid for pseudorefsMartin Ågren, May 10, 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.