]> git.ipfire.org Git - thirdparty/git.git/commit - reflog.c
reflog: libify delete reflog function and helpers
authorJohn Cai <johncai86@gmail.com>
Wed, 2 Mar 2022 22:27:23 +0000 (22:27 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Mar 2022 23:24:47 +0000 (15:24 -0800)
commit7d3d226e700904d6fbf3d9a1b351ebeb02f2cf04
tree0c8473928ccf8f1e578a92c37ce03299928125d0
parent76bccbcfe2ff0d75302b0bf98b82aba95f8fc937
reflog: libify delete reflog function and helpers

Currently stash shells out to reflog in order to delete refs. In an
effort to reduce how much we shell out to a subprocess, libify the
functionality that stash needs into reflog.c.

Add a reflog_delete function that is pretty much the logic in the while
loop in builtin/reflog.c cmd_reflog_delete(). This is a function that
builtin/reflog.c and builtin/stash.c can both call.

Also move functions needed by reflog_delete and export them.

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
builtin/reflog.c
object.h
reflog.c [new file with mode: 0644]
reflog.h [new file with mode: 0644]