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

Patrick Steinhardt committed Oct 31, 2023 at 09:16 UTC 53921d5f8e63eb98cb306ea0b58f76a07bbaf36b
1 file changed +1 -4
builtin/show-ref.c
+1 -4
@@ -183,11 +183,8 @@ static int cmd_show_ref__patterns(const char **patterns)
183 } else {
184 for_each_ref(show_ref, &show_ref_data);
185 }
186 - if (!found_match) {
187 - if (verify && !quiet)
188 - die("No match");
186 + if (!found_match)
187 return 1;
190 - }
188
189 return 0;
190 }