fetch: set remote/HEAD if it does not exist
When cloning a repository remote/HEAD is created, but when the user creates a repository with git init, and later adds a remote, remote/HEAD is only created if the user explicitly runs a variant of "remote set-head". Attempt to set remote/HEAD during fetch, if the user does not have it already set. Silently ignore any errors. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
9963746c84
commit
3f763ddf28
@ -52,7 +52,8 @@ test_expect_success LONG_REF 'fetch handles extremely long refname' '
|
||||
long
|
||||
main
|
||||
EOF
|
||||
git for-each-ref --format="%(subject)" refs/remotes/long >actual &&
|
||||
git for-each-ref --format="%(subject)" refs/remotes/long \
|
||||
--exclude=refs/remotes/long/HEAD >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
|
Reference in New Issue
Block a user