aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Benedito <[email protected]>2020-11-16 23:24:32 +0100
committerHiltjo Posthuma <[email protected]>2020-11-23 17:15:30 +0100
commit66df204c440de3b0cf3442d3a0c719016cdcf9c6 (patch)
tree921cc25134ce78ed31e2bbdc87e44cac2afad314
parenta63645a5ea4e60523c0024f69c627f586b601d82 (diff)
downloadstagit-66df204c440de3b0cf3442d3a0c719016cdcf9c6.tar.gz
stagit-66df204c440de3b0cf3442d3a0c719016cdcf9c6.zip
add abbreviated commit hash to submodule file
-rw-r--r--stagit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/stagit.c b/stagit.c
index 12a76a4..1cdaee8 100644
--- a/stagit.c
+++ b/stagit.c
@@ -977,7 +977,7 @@ writefilestree(FILE *fp, git_tree *tree, const char *path)
git_object *obj = NULL;
git_off_t filesize;
const char *entryname;
- char filepath[PATH_MAX], entrypath[PATH_MAX];
+ char filepath[PATH_MAX], entrypath[PATH_MAX], oid[8];
size_t count, i, lc;
int r, ret;
@@ -1031,7 +1031,10 @@ 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);
+ git_oid_tostr(oid, sizeof(oid), git_tree_entry_id(entry));
+ xmlencode(fp, oid, strlen(oid));
+ fputs("</td><td class=\"num\" align=\"right\"></td></tr>\n", fp);
}
}