diff options
| author | Karthik Nayak <karthik.188@gmail.com> | 2024-06-07 15:33:02 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-06-07 10:25:45 -0700 |
| commit | ed3272720eb5ac8fca0e555d1f64a145140e69dd (patch) | |
| tree | 8d02486c8d595c67e5a8f934fa493c444642fe3f /Documentation/git-update-ref.txt | |
| parent | 2343720967aac3725148e1a6690dbe6c98fe5f2e (diff) | |
| download | git-ed3272720eb5ac8fca0e555d1f64a145140e69dd.tar.xz | |
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>
Diffstat (limited to 'Documentation/git-update-ref.txt')
| -rw-r--r-- | Documentation/git-update-ref.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Documentation/git-update-ref.txt b/Documentation/git-update-ref.txt index 16e02f6979..364ef78af1 100644 --- a/Documentation/git-update-ref.txt +++ b/Documentation/git-update-ref.txt @@ -65,6 +65,7 @@ performs all modifications together. Specify commands of the form: create SP <ref> SP <new-oid> LF delete SP <ref> [SP <old-oid>] LF verify SP <ref> [SP <old-oid>] LF + symref-create SP <ref> SP <new-target> LF symref-delete SP <ref> [SP <old-target>] LF symref-verify SP <ref> [SP <old-target>] LF option SP <opt> LF @@ -88,6 +89,7 @@ quoting: create SP <ref> NUL <new-oid> NUL delete SP <ref> NUL [<old-oid>] NUL verify SP <ref> NUL [<old-oid>] NUL + symref-create SP <ref> NUL <new-target> NUL symref-delete SP <ref> [NUL <old-target>] NUL symref-verify SP <ref> [NUL <old-target>] NUL option SP <opt> NUL @@ -121,6 +123,10 @@ verify:: Verify <ref> against <old-oid> but do not change it. If <old-oid> is zero or missing, the ref must not exist. +symref-create: + Create symbolic ref <ref> with <new-target> after verifying + it does not exist. + symref-delete:: Delete <ref> after verifying it exists with <old-target>, if given. |
