Skip to content

Commit

Permalink
add_ref_decoration(): convert local variable original_sha1 to object_id
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed May 25, 2015
1 parent f124b73 commit 3d79f65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions log-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
assert(cb_data == NULL);

if (starts_with(refname, "refs/replace/")) {
unsigned char original_sha1[20];
struct object_id original_oid;
if (!check_replace_refs)
return 0;
if (get_sha1_hex(refname + 13, original_sha1)) {
if (get_oid_hex(refname + 13, &original_oid)) {
warning("invalid replace ref %s", refname);
return 0;
}
obj = parse_object(original_sha1);
obj = parse_object(original_oid.hash);
if (obj)
add_name_decoration(DECORATION_GRAFTED, "replaced", obj);
return 0;
Expand Down

0 comments on commit 3d79f65

Please sign in to comment.