v->s = xstrdup(buf + 1);
}
continue;
- }
- else if (!deref && grab_objectname(name, ref->objectname, v))
++ } else if (!deref && grab_objectname(name, ref->objectname, v)) {
+ continue;
- else
+ } else if (!strcmp(name, "HEAD")) {
+ const char *head;
+ unsigned char sha1[20];
+
+ head = resolve_ref_unsafe("HEAD", sha1, 1, NULL);
+ if (!strcmp(ref->refname, head))
+ v->s = "*";
+ else
+ v->s = " ";
+ continue;
+ } else
continue;
formatp = strchr(name, ':');
test_atom tag tree ''
test_atom tag parent ''
test_atom tag numparent ''
- test_atom tag object '67a36f10722846e891fbada1ba48ed035de75581'
+ test_atom tag object $(git rev-parse refs/tags/testtag^0)
test_atom tag type 'commit'
+test_atom tag '*objectname' '67a36f10722846e891fbada1ba48ed035de75581'
+test_atom tag '*objecttype' 'commit'
test_atom tag author ''
test_atom tag authorname ''
test_atom tag authoremail ''