summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-07 15:20:39 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-07 15:20:39 -0700
commita57f0b58d7d4aee2b874ff349e53b9f7ee3aeb54 (patch)
treec1e748407f93893aed558df4ea56836bcd455e90
parentb5b425074e5f84f261b1290b1a83eca635c49147 (diff)
downloadgit-a57f0b58d7d4aee2b874ff349e53b9f7ee3aeb54.tar.gz
git-read-tree: -u without -m is meaningless. Don't allow it.
Also, documetn the "-u" in the usage string.
-rw-r--r--read-tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/read-tree.c b/read-tree.c
index cf6d28e2c9..fbd0da0ebd 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 (<sha> | -m <sha1> [<sha2> [<sha3>]])";
+static char *read_tree_usage = "git-read-tree (<sha> | -m [-u] <sha1> [<sha2> [<sha3>]])";
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,