diff options
author | Anas Nashif <anas.nashif@intel.com> | 2013-02-15 11:39:29 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2013-02-15 11:39:29 -0800 |
commit | ee5a57bc5c5641c30bc626892ddc31ddd18ed7ad (patch) | |
tree | 5f1b1cf96ba7fd0f29317e4fa863a2c29db97532 /builtin/show-ref.c | |
parent | 264628a2b3a5cb6c7671ea87ceecab941ec290e9 (diff) | |
download | git-ee5a57bc5c5641c30bc626892ddc31ddd18ed7ad.tar.gz git-ee5a57bc5c5641c30bc626892ddc31ddd18ed7ad.tar.bz2 git-ee5a57bc5c5641c30bc626892ddc31ddd18ed7ad.zip |
Imported Upstream version 1.8.1.3upstream/1.8.1.3
Diffstat (limited to 'builtin/show-ref.c')
-rw-r--r-- | builtin/show-ref.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/builtin/show-ref.c b/builtin/show-ref.c index 4eb016d6..8d9b76a0 100644 --- a/builtin/show-ref.c +++ b/builtin/show-ref.c @@ -28,7 +28,6 @@ static void show_one(const char *refname, const unsigned char *sha1) static int show_ref(const char *refname, const unsigned char *sha1, int flag, void *cbdata) { - struct object *obj; const char *hex; unsigned char peeled[20]; @@ -79,25 +78,9 @@ match: if (!deref_tags) return 0; - if ((flag & REF_ISPACKED) && !peel_ref(refname, peeled)) { - if (!is_null_sha1(peeled)) { - hex = find_unique_abbrev(peeled, abbrev); - printf("%s %s^{}\n", hex, refname); - } - } - else { - obj = parse_object(sha1); - if (!obj) - die("git show-ref: bad ref %s (%s)", refname, - sha1_to_hex(sha1)); - if (obj->type == OBJ_TAG) { - obj = deref_tag(obj, refname, 0); - if (!obj) - die("git show-ref: bad tag at ref %s (%s)", refname, - sha1_to_hex(sha1)); - hex = find_unique_abbrev(obj->sha1, abbrev); - printf("%s %s^{}\n", hex, refname); - } + if (!peel_ref(refname, peeled)) { + hex = find_unique_abbrev(peeled, abbrev); + printf("%s %s^{}\n", hex, refname); } return 0; } |