Introduction
Introduction Statistics Contact Development Disclaimer Help
tlookup commits of annotated tags - stagit - static git page generator
git clone git://src.adamsgaard.dk/stagit
Log
Files
Refs
README
LICENSE
---
commit d045340ea048e3aa45af719caadad413efdfda4d
parent 9128782aa848465c47928d4ce8f40bd3320a5661
Author: Hiltjo Posthuma <[email protected]>
Date: Wed, 6 Jan 2016 15:35:34 +0100
lookup commits of annotated tags
NOTE: as described in the TODO this will be rewritten more cleanly
later using git_reference_*.
Diffstat:
M stagit.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/stagit.c b/stagit.c
t@@ -875,6 +875,7 @@ writetags(FILE *fp)
struct commitinfo *ci;
git_strarray tagnames;
git_object *obj = NULL;
+ git_tag *tag = NULL;
const git_oid *id = NULL;
size_t i, len;
t@@ -900,6 +901,18 @@ writetags(FILE *fp)
if (git_revparse_single(&obj, repo, tagnames.strings[i]))
continue;
id = git_object_id(obj);
+
+ /* lookup actual commit (from annotated tag etc) */
+ if (!git_tag_lookup(&tag, repo, id)) {
+ git_object_free(obj);
+ obj = NULL;
+ if (git_tag_peel(&obj, tag))
+ break;
+ git_tag_free(tag);
+ tag = NULL;
+ id = git_object_id(obj);
+ }
+
if (!(ci = commitinfo_getbyoid(id)))
break;
t@@ -936,9 +949,12 @@ writetags(FILE *fp)
commitinfo_free(ci);
git_object_free(obj);
+ obj = NULL;
}
fputs("</tbody></table>", fp);
git_strarray_free(&tagnames);
+ git_tag_free(tag);
+ git_object_free(obj);
return 0;
}
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.