tMerge branch 'master' of git://git.codemadness.org/stagit - stagit - [fork] customized build of stagit, the static git page generator
(HTM) git clone git://src.adamsgaard.dk/stagit
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 6b4b99114972aea964ed76127d32dff0bfb1ac19
(DIR) parent 3c8cf6cdf02c10a918d0b656dd4bccc459a8fdbd
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 11 Aug 2020 08:15:01 +0200
Merge branch 'master' of git://git.codemadness.org/stagit
Diffstat:
M stagit-index.c | 4 ----
M stagit.c | 21 ++++++++-------------
2 files changed, 8 insertions(+), 17 deletions(-)
---
(DIR) diff --git a/stagit-index.c b/stagit-index.c
t@@ -157,10 +157,6 @@ main(int argc, char *argv[])
git_libgit2_init();
#ifdef __OpenBSD__
- for (i = 1; i < argc; i++)
- if (unveil(argv[i], "r") == -1)
- err(1, "unveil: %s", argv[i]);
-
if (pledge("stdio rpath", NULL) == -1)
err(1, "pledge");
#endif
(DIR) diff --git a/stagit.c b/stagit.c
t@@ -868,21 +868,17 @@ writeatom(FILE *fp, int all)
commitinfo_free(ci);
}
git_revwalk_free(w);
- } else {
+ } else if (getrefs(&ris, &refcount) != -1) {
/* references: tags */
- if (getrefs(&ris, &refcount) != -1) {
- for (i = 0; i < refcount; i++) {
- if (!git_reference_is_tag(ris[i].ref))
- continue;
-
+ for (i = 0; i < refcount; i++) {
+ if (git_reference_is_tag(ris[i].ref))
printcommitatom(fp, ris[i].ci,
git_reference_shorthand(ris[i].ref));
- commitinfo_free(ris[i].ci);
- git_reference_free(ris[i].ref);
- }
- free(ris);
+ commitinfo_free(ris[i].ci);
+ git_reference_free(ris[i].ref);
}
+ free(ris);
}
fputs("</feed>\n", fp);
t@@ -979,7 +975,6 @@ int
writefilestree(FILE *fp, git_tree *tree, const char *path)
{
const git_tree_entry *entry = NULL;
- git_submodule *module = NULL;
git_object *obj = NULL;
git_off_t filesize;
const char *entryname;
t@@ -1032,11 +1027,11 @@ writefilestree(FILE *fp, git_tree *tree, const char *path)
fprintf(fp, "%juB", (uintmax_t)filesize);
fputs("</td></tr>\n", fp);
git_object_free(obj);
- } else if (!git_submodule_lookup(&module, repo, entryname)) {
+ } else if (git_tree_entry_type(entry) == GIT_OBJ_COMMIT) {
+ /* commit object in tree is a submodule */
fprintf(fp, "<tr><td>m---------</td><td><a href=\"%sfile/.gitmodules.html\">",
relpath);
xmlencode(fp, entrypath, strlen(entrypath));
- git_submodule_free(module);
fputs("</a></td><td class=\"num\" align=\"right\"></td></tr>\n", fp);
}
}