]> git.ipfire.org Git - thirdparty/git.git/commit
update-ref: add support for 'symref-create' command
authorKarthik Nayak <karthik.188@gmail.com>
Fri, 7 Jun 2024 13:33:02 +0000 (15:33 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Jun 2024 17:25:45 +0000 (10:25 -0700)
commited3272720eb5ac8fca0e555d1f64a145140e69dd
tree8d02486c8d595c67e5a8f934fa493c444642fe3f
parent2343720967aac3725148e1a6690dbe6c98fe5f2e
update-ref: add support for 'symref-create' command

Add 'symref-create' command to the '--stdin' mode 'git-update-ref' to
allow creation of symbolic refs in a transaction. The 'symref-create'
command takes in a <new-target>, which the created <ref> will point to.

Also, support the 'core.prefersymlinkrefs' config, wherein if the config
is set and the filesystem supports symlinks, we create the symbolic ref
as a symlink. We fallback to creating a regular symref if creating the
symlink is unsuccessful.

Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-update-ref.txt
builtin/clone.c
builtin/update-ref.c
refs.c
refs.h
t/t0600-reffiles-backend.sh
t/t1400-update-ref.sh
t/t1416-ref-transaction-hooks.sh
t/t5605-clone-local.sh