Skip to content

Commit 53921d5

Browse files
pks-tgitster
authored andcommitted
builtin/show-ref: fix dead code when passing patterns
When passing patterns to `git show-ref` we have some code that will cause us to die if `verify && !quiet` is true. But because `verify` indicates a different subcommand of git-show-ref(1) that causes us to execute `cmd_show_ref__verify()` and not `cmd_show_ref__patterns()`, the condition cannot ever be true. Let's remove this dead code. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dbabd0b commit 53921d5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

builtin/show-ref.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,8 @@ static int cmd_show_ref__patterns(const char **patterns)
183183
} else {
184184
for_each_ref(show_ref, &show_ref_data);
185185
}
186-
if (!found_match) {
187-
if (verify && !quiet)
188-
die("No match");
186+
if (!found_match)
189187
return 1;
190-
}
191188

192189
return 0;
193190
}

0 commit comments

Comments
 (0)