]> git.ipfire.org Git - thirdparty/git.git/commit - worktree.c
worktree: teach worktree to lazy-load "prunable" reason
authorRafael Silva <rafaeloliveira.cs@gmail.com>
Tue, 19 Jan 2021 21:27:34 +0000 (22:27 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 30 Jan 2021 17:57:16 +0000 (09:57 -0800)
commitfc0c7d5e9e9e396afdd669019e7635773b1d1423
treeddf3a3ab934adb31ebc0181608d35555707a155b
parenta29a8b7574ab34026252691933f462eddc59146a
worktree: teach worktree to lazy-load "prunable" reason

Add worktree_prune_reason() to allow a caller to discover whether a
worktree is prunable and the reason that it is, much like
worktree_lock_reason() indicates whether a worktree is locked and the
reason for the lock. As with worktree_lock_reason(), retrieve the
prunable reason lazily and cache it in the `worktree` structure.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Rafael Silva <rafaeloliveira.cs@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
worktree.c
worktree.h