]> git.ipfire.org Git - thirdparty/git.git/commitdiff
worktree: give "should be pruned?" function more meaningful name
authorEric Sunshine <sunshine@sunshineco.com>
Wed, 10 Jun 2020 06:30:44 +0000 (02:30 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Jun 2020 17:54:49 +0000 (10:54 -0700)
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>
builtin/worktree.c

index 27325f42c570f17cb85d9b553bee0b0784c2f648..0402f244ea9ebd27278a680528720f9a8f93342d 100644 (file)
@@ -67,7 +67,7 @@ static void delete_worktrees_dir_if_empty(void)
        rmdir(git_path("worktrees")); /* ignore failed removal */
 }
 
-static int prune_worktree(const char *id, struct strbuf *reason)
+static int should_prune_worktree(const char *id, struct strbuf *reason)
 {
        struct stat st;
        char *path;
@@ -144,7 +144,7 @@ static void prune_worktrees(void)
                if (is_dot_or_dotdot(d->d_name))
                        continue;
                strbuf_reset(&reason);
-               if (!prune_worktree(d->d_name, &reason))
+               if (!should_prune_worktree(d->d_name, &reason))
                        continue;
                if (show_only || verbose)
                        printf_ln(_("Removing %s/%s: %s"),