summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOscar Benedito <oscar@oscarbenedito.com>2020-09-10 01:11:53 +0200
committerOscar Benedito <oscar@oscarbenedito.com>2020-09-10 01:11:53 +0200
commitea2f8521c49df0f10de5e6d8a97842c0df7c47b0 (patch)
tree72aed9282c57906e5a1f17294f346c5d7bdd7e1b
parent1e35b0fa08a98e532ede60f4add7a91f8030deb6 (diff)
Add tracked commit short OID to submodules
-rw-r--r--stagit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/stagit.c b/stagit.c
index 63c2ddc..ca6bc70 100644
--- a/stagit.c
+++ b/stagit.c
@@ -1065,7 +1065,12 @@ writefilestree(FILE *fp, git_tree *tree, const char *path)
fprintf(fp, "<tr><td>m---------</td><td><a href=\"%sfile/.gitmodules.html\">",
relpath);
xmlencode(fp, entrypath, strlen(entrypath));
- fputs("</a></td><td class=\"num\" align=\"right\"></td></tr>\n", fp);
+ fputs("</a> @ ", fp);
+ const git_oid* oid = git_tree_entry_id(entry);
+ char oidstr[8];
+ git_oid_tostr(oidstr, sizeof(oidstr), oid);
+ fprintf(fp, "%s</td><td class=\"num\" align=\"right\"></td></tr>\n",
+ oidstr);
}
}