Skip to content

dangling symrefs and fetchRemoteHEAD=create

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4t5510: make confusing config cleanup more explicitt/t5510-fetch.sh+9 -93 replies
2/4t5510: stop changing top-level working directoryt/t5510-fetch.sh+161 -1950 replies
3/4t5510: prefer "git -C" to subshell for followRemoteHEAD testst/t5510-fetch.sh+83 -1194 replies
4/4refs: do not clobber dangling symrefsrefs/files-backend.c refs/reftable-backend.c t/t1400-update-ref.sh +1 more+87 -79 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] dangling symrefs and fetchRemoteHEAD=create

This fixes a bug I found while investigating another semi-related bug (that has already been fixed by Patrick), mentioned in the "PS" here:

https://lore.kernel.org/git/[email protected]/

The issue is that:

git remote add -m does-not-exist origin <url> git config remote.origin.followRemoteHEAD create git fetch

will overwrite the refs/remotes/origin/HEAD we created, even though we asked it to do so only on creation. The issue is actually in the refs code, and how it perceives dangling symrefs with respect to creation events. And so this actually affects "update-ref", as well.

A fix is in the final patch, along with a detailed explanation. The earlier patches are just cleanup of the related test script before we add our new test there.

[1/4]: t5510: make confusing config cleanup more explicit [2/4]: t5510: stop changing top-level working directory [3/4]: t5510: prefer "git -C" to subshell for followRemoteHEAD tests [4/4]: refs: do not clobber dangling symrefs

 refs/files-backend.c    |  34 ++-
 refs/reftable-backend.c |  30 ++-
 t/t1400-update-ref.sh   |  21 ++
 t/t5510-fetch.sh        | 543 ++++++++++++++++++----------------------
 4 files changed, 319 insertions(+), 309 deletions(-)

-Peff