"John Cai via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > From: John Cai <johncai86@xxxxxxxxx> > > 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@xxxxxxxxx> > Signed-off-by: John Cai <johncai86@xxxxxxxxx> > --- > Makefile | 1 + > builtin/reflog.c | 451 +---------------------------------------------- > object.h | 2 +- > reflog.c | 435 +++++++++++++++++++++++++++++++++++++++++++++ > reflog.h | 49 +++++ > 5 files changed, 490 insertions(+), 448 deletions(-) > create mode 100644 reflog.c > create mode 100644 reflog.h This round, without polluting global namespace in reflog.h by moving too many things there and instead keeping what is private to the implementation in reflog.c, looks much better than the previous round. Looking good. Thanks.