summaryrefslogtreecommitdiff
path: root/builtin-read-tree.c
diff options
context:
space:
mode:
authorStephen Boyd <bebarino@gmail.com>2009-06-25 22:14:09 -0700
committerJunio C Hamano <gitster@pobox.com>2009-06-27 14:11:28 -0700
commita429d2dd76c81cb52fb17463821a457e541637ce (patch)
treec2201cd471885ab50d09fc377b42d19fef43b18a /builtin-read-tree.c
parent916e1373fb86db9d7019de4e7e74e39c9474a153 (diff)
downloadgit-a429d2dd76c81cb52fb17463821a457e541637ce.tar.gz
read-tree: convert unhelpful usage()'s to helpful die()'s
Printing the usage message when encountering bad option combinations is not very helpful. Instead, die with a message which tells the user exactly what combination is invalid. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-read-tree.c')
-rw-r--r--builtin-read-tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 82e25eaa07..17c96310ab 100644
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
@@ -145,9 +145,8 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
continue;
}
- /* using -u and -i at the same time makes no sense */
if (1 < opts.index_only + opts.update)
- usage(read_tree_usage);
+ die("-u and -i at the same time makes no sense");
if (get_sha1(arg, sha1))
die("Not a valid object name %s", arg);
@@ -156,7 +155,8 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
stage++;
}
if ((opts.update||opts.index_only) && !opts.merge)
- usage(read_tree_usage);
+ die("%s is meaningless without -m, --reset, or --prefix",
+ opts.update ? "-u" : "-i");
if ((opts.dir && !opts.update))
die("--exclude-per-directory is meaningless unless -u");
if (opts.merge && !opts.index_only)