[PATCH v5 22/25] commit-tree: the command wants a tree and commits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
---
 builtin/commit-tree.c               | 8 ++++----
 t/t1512-rev-parse-disambiguation.sh | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index 164b655..cb982c5 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -48,8 +48,8 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
 	if (argc < 2 || !strcmp(argv[1], "-h"))
 		usage(commit_tree_usage);
 
-	if (get_sha1(argv[1], tree_sha1))
-		die("Not a valid object name %s", argv[1]);
+	if (get_sha1_tree(argv[1], tree_sha1))
+		die("Not a valid tree object name %s", argv[1]);
 
 	for (i = 1; i < argc; i++) {
 		const char *arg = argv[i];
@@ -57,7 +57,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
 			unsigned char sha1[20];
 			if (argc <= ++i)
 				usage(commit_tree_usage);
-			if (get_sha1(argv[i], sha1))
+			if (get_sha1_commit(argv[i], sha1))
 				die("Not a valid object name %s", argv[i]);
 			assert_sha1_type(sha1, OBJ_COMMIT);
 			new_parent(lookup_commit(sha1), &parents);
@@ -104,7 +104,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
 			continue;
 		}
 
-		if (get_sha1(arg, tree_sha1))
+		if (get_sha1_tree(arg, tree_sha1))
 			die("Not a valid object name %s", arg);
 		if (got_tree)
 			die("Cannot give more than one trees");
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 87270c9..dd42729 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -74,7 +74,7 @@ test_expect_success 'disambiguate blob' '
 	test_cmp bz01t33 actual
 '
 
-test_expect_failure 'disambiguate tree' '
+test_expect_success 'disambiguate tree' '
 	commit=$(echo "frotz" | git commit-tree 11021982) &&
 	test $(git rev-parse $commit^{tree}) = $(git rev-parse 1102198206)
 '
@@ -97,7 +97,7 @@ test_expect_success 'disambiguate commit-ish' '
 	git rev-parse --verify 11021982^0
 '
 
-test_expect_failure 'disambiguate commit' '
+test_expect_success 'disambiguate commit' '
 	commit=$(echo "frotz" | git commit-tree 11021982 -p 11021982) &&
 	test $(git rev-parse $commit^) = $(git rev-parse 1102198268)
 '
-- 
1.7.11.1.229.g706c98f

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]