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

Re: [PATCH] t9104: kosherly remove remote refs

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jun 2, 2018, 12:28 UTC
Message-ID
<CAM0VKj=YgNAb_-BfhBJNjYScfUCnU9Vp_Upy7jtyBisYXzg8Ng@mail.gmail.com>
In-Reply-To
<20180601050833.27676-1-chriscool@tuxfamily.org>

On Fri, Jun 1, 2018 at 7:08 AM, Christian Couder <christian.couder@gmail.com> wrote:

Show 5 quoted lines
>  test_expect_success "multi-fetch works off a 'clean' repository" '
> -       rm -rf "$GIT_DIR/svn" "$GIT_DIR/refs/remotes" &&
> +       rm -rf "$GIT_DIR/svn" &&
> +       git for-each-ref --format="option no-deref%0adelete %(refname)" refs/remotes |
> +       git update-ref --stdin &&

Is that "option no-deref" really necessary when deleting refs? Does it have any effect at all?

The synopsis in 'git update-ref's manpage indicates that '--no-deref' is only applicable when updating a ref, but not when deleting one; though the usage shown by 'git update-ref -h' doesn't indicate this. Anyway, it appears that when deleting refs no symref dereferencing is performed and '--no-deref' is simply ignored:

  $ git branch one
  $ git branch two
  $ git symbolic-ref ONE refs/heads/one
  $ git symbolic-ref TWO refs/heads/two
  $ cat .git/{ONE,TWO}
  ref: refs/heads/one
  ref: refs/heads/two
  $ git update-ref -d ONE
  $ git update-ref --no-deref -d TWO
  $ cat .git/{ONE,TWO}
  cat: .git/ONE: No such file or directory
  cat: .git/TWO: No such file or directory
  $ git for-each-ref
  95c5b8654fd75df13ed29f43cff52287414c3877 commit       refs/heads/master
  95c5b8654fd75df13ed29f43cff52287414c3877 commit       refs/heads/one
  95c5b8654fd75df13ed29f43cff52287414c3877 commit       refs/heads/two
Previous: Michael Haggerty
Message 4 of 4 in “t9104: kosherly remove remote refs”
  1. t9104: kosherly remove remote refsChristian Couder, Jun 1, 2018
  2. Johannes SchindelinJun 1, 2018
  3. Michael HaggertyJun 2, 2018
  4. SZEDER GáborJun 2, 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.