diff options
author | Rafael Silva <rafaeloliveira.cs@gmail.com> | 2021-01-19 22:27:33 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-01-30 09:57:08 -0800 |
commit | a29a8b7574ab34026252691933f462eddc59146a (patch) | |
tree | 63f26ea5798bce6632dff33f04f949f4f3f8fc92 /ref-filter.c | |
parent | The third batch (diff) | |
download | tgif-a29a8b7574ab34026252691933f462eddc59146a.tar.xz |
worktree: libify should_prune_worktree()
As part of teaching "git worktree list" to annotate worktree that is a
candidate for pruning, let's move should_prune_worktree() from
builtin/worktree.c to worktree.c in order to make part of the worktree
public API.
should_prune_worktree() knows how to select the given worktree for
pruning based on an expiration date, however the expiration value is
stored in a static file-scope variable and it is not local to the
function. In order to move the function, teach should_prune_worktree()
to take the expiration date as an argument and document the new
parameter that is not immediately obvious.
Also, change the function comment to clearly state that the worktree's
path is returned in `wtpath` argument.
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>
Diffstat (limited to 'ref-filter.c')
0 files changed, 0 insertions, 0 deletions