reduce scope of repodir, remove unused branch parameter
2 files changed, 7 insertions(+), 7 deletions(-) | |||
---|---|---|---|
M | stagit-index.c | +1 | -1 |
M | stagit.c | +6 | -6 |
1@@ -16,7 +16,6 @@
2 static git_repository *repo;
3
4 static const char *relpath = "";
5-static const char *repodir;
6
7 static char description[255] = "Repositories";
8 static char *name = "";
9@@ -157,6 +156,7 @@ main(int argc, char *argv[])
10 const git_error *e = NULL;
11 FILE *fp;
12 char path[PATH_MAX], repodirabs[PATH_MAX + 1];
13+ const char *repodir;
14 int i, ret = 0;
15
16 if (pledge("stdio rpath", NULL) == -1)
M · stagit.c
+6, -6 1@@ -57,7 +57,7 @@ static const char *relpath = "";
2 static const char *repodir;
3
4 static char *name = "";
5-static char *strippedname;
6+static char *strippedname = "";
7 static char description[255];
8 static char cloneurl[1024];
9 static int haslicense, hasreadme, hassubmodules;
10@@ -790,7 +790,7 @@ filemode(git_filemode_t m)
11 }
12
13 int
14-writefilestree(FILE *fp, git_tree *tree, const char *branch, const char *path)
15+writefilestree(FILE *fp, git_tree *tree, const char *path)
16 {
17 const git_tree_entry *entry = NULL;
18 git_submodule *module = NULL;
19@@ -819,7 +819,7 @@ writefilestree(FILE *fp, git_tree *tree, const char *branch, const char *path)
20 break;
21 case GIT_OBJ_TREE:
22 /* NOTE: recurses */
23- ret = writefilestree(fp, (git_tree *)obj, branch,
24+ ret = writefilestree(fp, (git_tree *)obj,
25 entrypath);
26 git_object_free(obj);
27 if (ret)
28@@ -856,7 +856,7 @@ writefilestree(FILE *fp, git_tree *tree, const char *branch, const char *path)
29 }
30
31 int
32-writefiles(FILE *fp, const git_oid *id, const char *branch)
33+writefiles(FILE *fp, const git_oid *id)
34 {
35 git_tree *tree = NULL;
36 git_commit *commit = NULL;
37@@ -868,7 +868,7 @@ writefiles(FILE *fp, const git_oid *id, const char *branch)
38
39 if (!git_commit_lookup(&commit, repo, id) &&
40 !git_commit_tree(&tree, commit))
41- ret = writefilestree(fp, tree, branch, "");
42+ ret = writefilestree(fp, tree, "");
43
44 fputs("</tbody></table>", fp);
45
46@@ -1153,7 +1153,7 @@ main(int argc, char *argv[])
47 fp = efopen("files.html", "w");
48 writeheader(fp, "Files");
49 if (head)
50- writefiles(fp, head, "HEAD");
51+ writefiles(fp, head);
52 writefooter(fp);
53 fclose(fp);
54