summaryrefslogtreecommitdiff
path: root/gitweb/gitweb.perl
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-01-08 11:05:47 +0100
committerJunio C Hamano <gitster@pobox.com>2024-01-08 13:17:30 -0800
commit8f4c00de954f809e83daf8b1425de82561f3721e (patch)
treeb79337c854f2c6cc5b74a7a75d90820b0f3c376b /gitweb/gitweb.perl
parentb8a846b2e03610e6f550d364c75e514532ef7adf (diff)
builtin/worktree: create refdb via ref backend
When creating a worktree we create the worktree's ref database manually by first writing a "HEAD" file so that the directory is recognized as a Git repository by other commands, and then running git-update-ref(1) or git-symbolic-ref(1) to write the actual value. But while this is fine for the files backend, this logic simply assumes too much about how the ref backend works and will leave behind an invalid ref database once any other ref backend lands. Refactor the code to instead use `refs_init_db()` to initialize the ref database so that git-worktree(1) itself does not need to know about how to initialize it. This will allow future ref backends to customize how the per-worktree ref database is set up. Furthermore, as we now already have a worktree ref store around, we can also avoid spawning external commands to write the HEAD reference and instead use the refs API to do so. Note that we do not have an equivalent to passing the `--quiet` flag to git-symbolic-ref(1) as we did before. This flag does not have an effect anyway though, as git-symbolic-ref(1) only honors it when reading a symref, but never when writing one. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.perl')
0 files changed, 0 insertions, 0 deletions