]> git.ipfire.org Git - thirdparty/git.git/commit
fetch: set remote/HEAD if it does not exist
authorBence Ferdinandy <bence@ferdinandy.com>
Fri, 22 Nov 2024 12:28:50 +0000 (13:28 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Nov 2024 02:46:37 +0000 (11:46 +0900)
commit3f763ddf28d28fe63963991513c8db4045eabadc
tree128738e283defd82ac8e3155745988a41c74937c
parent9963746c841dc786529827b7b6755d0a3e208ad4
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>
12 files changed:
builtin/fetch.c
t/t4207-log-decoration-colors.sh
t/t5505-remote.sh
t/t5510-fetch.sh
t/t5512-ls-remote.sh
t/t5514-fetch-multiple.sh
t/t5516-fetch-push.sh
t/t5527-fetch-odd-refs.sh
t/t7900-maintenance.sh
t/t9210-scalar.sh
t/t9211-scalar-clone.sh
t/t9902-completion.sh