Add several uses of get_object_hash.
[gitweb.git] / builtin / rev-parse.c
index 02d747dcb1a318af98ec06a7ab2f4e489e7c2625..9985949ccc1d64a6ee0284487ccf4e1776cb4647 100644 (file)
@@ -281,11 +281,8 @@ static int try_difference(const char *arg)
                        b = lookup_commit_reference(end);
                        exclude = get_merge_bases(a, b);
                        while (exclude) {
-                               struct commit_list *n = exclude->next;
-                               show_rev(REVERSED,
-                                        exclude->item->object.sha1,NULL);
-                               free(exclude);
-                               exclude = n;
+                               struct commit *commit = pop_commit(&exclude);
+                               show_rev(REVERSED, get_object_hash(commit->object), NULL);
                        }
                }
                *dotdot = '.';
@@ -322,7 +319,7 @@ static int try_parent_shorthands(const char *arg)
        commit = lookup_commit_reference(sha1);
        for (parents = commit->parents; parents; parents = parents->next)
                show_rev(parents_only ? NORMAL : REVERSED,
-                               parents->item->object.sha1, arg);
+                               get_object_hash(parents->item->object), arg);
 
        *dotdot = '^';
        return 1;