Merge http://www.kernel.org/pub/scm/gitk/gitk
[git.git] / name-rev.c
index 21fecdf..7d89401 100644 (file)
@@ -164,7 +164,7 @@ int main(int argc, char **argv)
                        continue;
                }
 
-               o = deref_tag(parse_object(sha1));
+               o = deref_tag(parse_object(sha1), *argv, 0);
                if (!o || o->type != commit_type) {
                        fprintf(stderr, "Could not get commit for %s. Skipping.\n",
                                        *argv);
@@ -217,10 +217,9 @@ int main(int argc, char **argv)
                                        if (!strcmp(name, "undefined"))
                                                continue;
 
-                                       fwrite(p_start, p - p_start, 1, stdout);
-                                       fputc('(', stdout);
-                                       fputs(name, stdout);
-                                       fputc(')', stdout);
+                                       fwrite(p_start, p - p_start + 1, 1,
+                                              stdout);
+                                       printf(" (%s)", name);
                                        p_start = p + 1;
                                }
                        }
@@ -230,8 +229,6 @@ int main(int argc, char **argv)
                                fwrite(p_start, p - p_start, 1, stdout);
                }
        } else if (all) {
-               extern struct object **objs;
-               extern int nr_objs;
                int i;
 
                for (i = 0; i < nr_objs; i++)