Convert struct ref to use object_id.
[gitweb.git] / walker.c
index 44a936c1cfddfac538afa66e76cea295577b136d..ce2f57abe79a68539b8c48e3c024d7826ad34417 100644 (file)
--- a/walker.c
+++ b/walker.c
@@ -17,10 +17,9 @@ void walker_say(struct walker *walker, const char *fmt, const char *hex)
 
 static void report_missing(const struct object *obj)
 {
-       char missing_hex[41];
-       strcpy(missing_hex, sha1_to_hex(obj->sha1));
        fprintf(stderr, "Cannot obtain needed %s %s\n",
-               obj->type ? typename(obj->type): "object", missing_hex);
+               obj->type ? typename(obj->type): "object",
+               sha1_to_hex(obj->sha1));
        if (!is_null_sha1(current_commit_sha1))
                fprintf(stderr, "while processing commit %s.\n",
                        sha1_to_hex(current_commit_sha1));
@@ -191,7 +190,7 @@ static int interpret_target(struct walker *walker, char *target, unsigned char *
        if (!check_refname_format(target, 0)) {
                struct ref *ref = alloc_ref(target);
                if (!walker->fetch_ref(walker, ref)) {
-                       hashcpy(sha1, ref->old_sha1);
+                       hashcpy(sha1, ref->old_oid.hash);
                        free(ref);
                        return 0;
                }