aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/show-ref.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-12-27 14:52:25 -0800
committerJunio C Hamano <gitster@pobox.com>2023-12-27 14:52:25 -0800
commit73b1808fa3f9cd7c0a6e5e5079a9715bade5f4a0 (patch)
treedef0d28c9ad6bb9a9d2cfa15ff063f978cc090b9 /builtin/show-ref.c
parentMerge branch 'ps/reftable-fixes' (diff)
parentshow-ref: use die_for_incompatible_opt3() (diff)
downloadgit-73b1808fa3f9cd7c0a6e5e5079a9715bade5f4a0.tar.gz
git-73b1808fa3f9cd7c0a6e5e5079a9715bade5f4a0.zip
Merge branch 'rs/show-ref-incompatible-options'
Code clean-up for sanity checking of command line options for "git show-ref". * rs/show-ref-incompatible-options: show-ref: use die_for_incompatible_opt3()
Diffstat (limited to 'builtin/show-ref.c')
-rw-r--r--builtin/show-ref.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 7aac525a87..59d2291cbf 100644
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
@@ -315,9 +315,9 @@ int cmd_show_ref(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, show_ref_options,
show_ref_usage, 0);
- if ((!!exclude_existing_opts.enabled + !!verify + !!exists) > 1)
- die(_("only one of '%s', '%s' or '%s' can be given"),
- "--exclude-existing", "--verify", "--exists");
+ die_for_incompatible_opt3(exclude_existing_opts.enabled, "--exclude-existing",
+ verify, "--verify",
+ exists, "--exists");
if (exclude_existing_opts.enabled)
return cmd_show_ref__exclude_existing(&exclude_existing_opts);