@matheusbsbs / matheus-bagliano / commits / 1b14d40b38
Fork 0

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 <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Sunshine committed Jun 10, 2020 at 02:30 UTC 1b14d40b385580a366c92f8c2a9373e6fd7cb26f
1 file changed +2 -2
builtin/worktree.c
+2 -2
@@ -67,7 +67,7 @@ static void delete_worktrees_dir_if_empty(void)
67 rmdir(git_path("worktrees")); /* ignore failed removal */
68 }
69
70 -static int prune_worktree(const char *id, struct strbuf *reason)
70 +static int should_prune_worktree(const char *id, struct strbuf *reason)
71 {
72 struct stat st;
73 char *path;
@@ -144,7 +144,7 @@ static void prune_worktrees(void)
144 if (is_dot_or_dotdot(d->d_name))
145 continue;
146 strbuf_reset(&reason);
147 - if (!prune_worktree(d->d_name, &reason))
147 + if (!should_prune_worktree(d->d_name, &reason))
148 continue;
149 if (show_only || verbose)
150 printf_ln(_("Removing %s/%s: %s"),