]> Kevux Git Server - rit/commit
refs: move out stub modification to generic layer
authorKarthik Nayak <karthik.188@gmail.com>
Wed, 25 Feb 2026 09:40:43 +0000 (10:40 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Feb 2026 17:27:12 +0000 (09:27 -0800)
commit2a32ac429e9faaecaf1c15c18e7873da5754a8d7
tree575493512178fa566409f916d55e01d325fd92ea
parent4ffbb02ee4bde38b4792b93cfba48755b394a130
refs: move out stub modification to generic layer

When creating the reftable reference backend on disk, we create stubs to
ensure that the directory can be recognized as a Git repository. This is
done by calling `refs_create_refdir_stubs()`. Move this to the generic
layer as this is needed for all backends excluding from the files
backends. In an upcoming commit where we introduce alternate reference
backend locations, we'll have to also create stubs in the $GIT_DIR
irrespective of the backend being used. This commit builds the base to
add that logic.

Similarly, move the logic for deletion of stubs to the generic layer.
The files backend recursively calls the remove function of the
'packed-backend', here skip calling the generic function since that
would try to delete stubs.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
refs/files-backend.c
refs/reftable-backend.c