aboutsummaryrefslogtreecommitdiff
path: root/read-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-04-20 19:49:16 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-20 19:49:16 -0700
commitc5bac17ad21c8e79fcca21c366832e75be095322 (patch)
treede6864be255ba016d22ddef52cad71f35b334927 /read-tree.c
parent80913d4364c0be4d9b97eabcd2c8acb800c647c1 (diff)
downloadgit-c5bac17ad21c8e79fcca21c366832e75be095322.tar.gz
git-c5bac17ad21c8e79fcca21c366832e75be095322.tar.xz
[PATCH] Usage-string fixes.
Usage string fixes to make maintenance easier (only one instance of a string to update not multiple copies). I've spotted and corrected inconsistent usage text in diff-tree while doing this. Also diff-cache and read-tree usage text have been corrected to match their up-to-date features. Earlier, neither "--cached" form of diff-cache nor "-m single-merge" form of read-tree were described. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'read-tree.c')
-rw-r--r--read-tree.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/read-tree.c b/read-tree.c
index 2773ce0cf..53351f05c 100644
--- a/read-tree.c
+++ b/read-tree.c
@@ -217,6 +217,8 @@ static void merge_stat_info(struct cache_entry **src, int nr)
}
}
+static char *read_tree_usage = "read-tree (<sha> | -m <sha1> [<sha2> <sha3>])";
+
int main(int argc, char **argv)
{
int i, newfd, merge;
@@ -236,20 +238,20 @@ int main(int argc, char **argv)
if (!strcmp(arg, "-m")) {
int i;
if (stage)
- usage("-m needs to come first");
+ die("-m needs to come first");
read_cache();
for (i = 0; i < active_nr; i++) {
if (ce_stage(active_cache[i]))
- usage("you need to resolve your current index first");
+ die("you need to resolve your current index first");
}
stage = 1;
merge = 1;
continue;
}
if (get_sha1_hex(arg, sha1) < 0)
- usage("read-tree [-m] <sha1>");
+ usage(read_tree_usage);
if (stage > 3)
- usage("can't merge more than two trees");
+ usage(read_tree_usage);
if (read_tree(sha1, "", 0) < 0)
die("failed to unpack tree object %s", arg);
stage++;