summaryrefslogtreecommitdiffstats
path: root/builtin-revert.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2010-02-11 22:06:43 +0100
committerJunio C Hamano <gitster@pobox.com>2010-02-12 07:11:01 +0100
commitdd9314cc2a2f353bf9438db14cbbf02a1c219bda (patch)
treef428338181d4c3468319c24e4edddf8d5f420f85 /builtin-revert.c
parentcherry-pick: rewrap advice message (diff)
downloadgit-dd9314cc2a2f353bf9438db14cbbf02a1c219bda.tar.xz
git-dd9314cc2a2f353bf9438db14cbbf02a1c219bda.zip
cherry-pick: refactor commit parsing code
These lines are really just lookup_commit_reference re-implemented. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r--builtin-revert.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/builtin-revert.c b/builtin-revert.c
index 83e5c0a755..012c64644d 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -68,15 +68,9 @@ static void parse_args(int argc, const char **argv)
if (get_sha1(arg, sha1))
die ("Cannot find '%s'", arg);
- commit = (struct commit *)parse_object(sha1);
+ commit = lookup_commit_reference(sha1);
if (!commit)
- die ("Could not find %s", sha1_to_hex(sha1));
- if (commit->object.type == OBJ_TAG) {
- commit = (struct commit *)
- deref_tag((struct object *)commit, arg, strlen(arg));
- }
- if (commit->object.type != OBJ_COMMIT)
- die ("'%s' does not point to a commit", arg);
+ exit(1);
}
static char *get_oneline(const char *message)