]> git.ipfire.org Git - thirdparty/git.git/commit - revision.c
revision.c: --reflog add HEAD reflog from all worktrees
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Wed, 23 Aug 2017 12:37:01 +0000 (19:37 +0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 24 Aug 2017 21:58:47 +0000 (14:58 -0700)
commitacd9544a8fdcf8095c82c91365c45dcb93112be3
tree0b2e19104274ef37dab7c5390134a38cd550f9b9
parent944b4e3013d6e21b1ecd2f2579395341f2cc8b7b
revision.c: --reflog add HEAD reflog from all worktrees

Note that add_other_reflogs_to_pending() is a bit inefficient, since
it scans reflog for all refs of each worktree, including shared refs,
so the shared ref's reflog is scanned over and over again.

We could update refs API to pass "per-worktree only" flag to avoid
that. But long term we should be able to obtain a "per-worktree only"
ref store and would need to revert the changes in reflog iteration
API. So let's just wait until then.

add_reflogs_to_pending() is called by reachable.c so by default "git
prune" will examine reflog from all worktrees.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c
t/t5304-prune.sh