From: Linus Torvalds Date: Tue, 7 Jun 2005 22:20:39 +0000 (-0700) Subject: git-read-tree: -u without -m is meaningless. Don't allow it. X-Git-Tag: v0.99~321 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a57f0b58d7d4aee2b874ff349e53b9f7ee3aeb54;p=git.git git-read-tree: -u without -m is meaningless. Don't allow it. Also, documetn the "-u" in the usage string. --- diff --git a/read-tree.c b/read-tree.c index cf6d28e2..fbd0da0e 100644 --- a/read-tree.c +++ b/read-tree.c @@ -275,7 +275,7 @@ static void merge_cache(struct cache_entry **src, int nr, merge_fn_t fn) check_updates(active_cache, active_nr); } -static char *read_tree_usage = "git-read-tree ( | -m [ []])"; +static char *read_tree_usage = "git-read-tree ( | -m [-u] [ []])"; static struct cache_file cache_file; @@ -320,6 +320,8 @@ int main(int argc, char **argv) die("failed to unpack tree object %s", arg); stage++; } + if (update && !merge) + usage(read_tree_usage); if (merge) { static const merge_fn_t merge_function[] = { [1] = oneway_merge,