resolve_gitlink_ref_recursive(): change to work with struct ref_cache
[gitweb.git] / reflog-walk.c
index 4879615cad7527dc5346cd1a85bd56b9d11e052b..da71a85851aa3664f14b406c57cbedbee79591f2 100644 (file)
@@ -51,8 +51,11 @@ static struct complete_reflogs *read_complete_reflog(const char *ref)
        if (reflogs->nr == 0) {
                unsigned char sha1[20];
                const char *name = resolve_ref(ref, sha1, 1, NULL);
-               if (name)
+               if (name) {
+                       name = xstrdup(name);
                        for_each_reflog_ent(name, read_one_reflog, reflogs);
+                       free((char *)name);
+               }
        }
        if (reflogs->nr == 0) {
                int len = strlen(ref);
@@ -239,7 +242,6 @@ void fake_reflog_parent(struct reflog_walk_info *info, struct commit *commit)
 
        commit->parents = xcalloc(sizeof(struct commit_list), 1);
        commit->parents->item = commit_info->commit;
-       commit->object.flags &= ~(ADDED | SEEN | SHOWN);
 }
 
 void get_reflog_selector(struct strbuf *sb,