Skip to content

Commit 1b14d40

Browse files
sunshinecogitster
authored andcommitted
worktree: give "should be pruned?" function more meaningful name
Readers of the name prune_worktree() are likely to expect the function to actually prune a worktree, however, it only answers the question "should this worktree be pruned?". Give it a name more reflective of its true purpose to avoid such confusion. Signed-off-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c9b77f2 commit 1b14d40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/worktree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static void delete_worktrees_dir_if_empty(void)
6767
rmdir(git_path("worktrees")); /* ignore failed removal */
6868
}
6969

70-
static int prune_worktree(const char *id, struct strbuf *reason)
70+
static int should_prune_worktree(const char *id, struct strbuf *reason)
7171
{
7272
struct stat st;
7373
char *path;
@@ -144,7 +144,7 @@ static void prune_worktrees(void)
144144
if (is_dot_or_dotdot(d->d_name))
145145
continue;
146146
strbuf_reset(&reason);
147-
if (!prune_worktree(d->d_name, &reason))
147+
if (!should_prune_worktree(d->d_name, &reason))
148148
continue;
149149
if (show_only || verbose)
150150
printf_ln(_("Removing %s/%s: %s"),

0 commit comments

Comments
 (0)