stagit
static git repository generator
git clone https://9o.is/git/stagit.git
commit 194eaaa5381bbfe3c045e5c17e106966c5ffae5f parent 2ddbbccd33668bd65130c204422e617eca554b4b Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 8 May 2016 20:35:49 +0200 check if LICENSE, README and .gitmodules is a file blob don't link to directory trees, etc. Thanks 600360 for reporting it! Diffstat:
| M | stagit.c | | | 11 | ++++++++--- |
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/stagit.c b/stagit.c @@ -1085,12 +1085,17 @@ main(int argc, char *argv[]) } /* check LICENSE */ - haslicense = !git_revparse_single(&obj, repo, "HEAD:LICENSE"); + haslicense = (!git_revparse_single(&obj, repo, "HEAD:LICENSE") && + git_object_type(obj) == GIT_OBJ_BLOB); git_object_free(obj); + /* check README */ - hasreadme = !git_revparse_single(&obj, repo, "HEAD:README"); + hasreadme = (!git_revparse_single(&obj, repo, "HEAD:README") && + git_object_type(obj) == GIT_OBJ_BLOB); git_object_free(obj); - hassubmodules = !git_revparse_single(&obj, repo, "HEAD:.gitmodules"); + + hassubmodules = (!git_revparse_single(&obj, repo, "HEAD:.gitmodules") && + git_object_type(obj) == GIT_OBJ_BLOB); git_object_free(obj); /* log for HEAD */