diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Trim the comments and dead code across the tree
Diffstat (limited to 'source/scan-tree.c')
-rw-r--r--source/scan-tree.c11
1 file changed, 6 insertions, 5 deletions
diff --git a/source/scan-tree.c b/source/scan-tree.c
index ac74eb3..f72a5be 100644
--- a/source/scan-tree.c
+++ b/source/scan-tree.c
@@ -15,7 +15,9 @@
// Git writes this line into the description file of every repository it
// creates, so a repository still carrying it gets cgit's own default instead.
-static const char *default_git_desc = "Unnamed repository; edit this file 'description' to name the repository.";
+static const char *default_git_desc =
+ "Unnamed repository; edit this file 'description' to name the "
+ "repository.";
// The config callbacks are handed only a name and a value, so the repository
// being filled in waits here for the length of one add_repo call.
@@ -88,7 +90,7 @@ static char *section_slash(struct strbuf *relpath, int depth)
if (depth > 0) {
slash = relpath->buf - 1;
- while (slash && depth && (slash = strchr(slash + 1, '/')))
+ while (depth && (slash = strchr(slash + 1, '/')))
depth--;
} else {
slash = relpath->buf + relpath->len;
@@ -150,9 +152,8 @@ static void add_repo(const char *base, struct strbuf *path)
else
strbuf_addstr(&relpath, path->buf + strlen(base) + 1);
- // Drop the trailing slash added above before testing for "/.git", since
- // with it still attached the suffix never matches and every ordinary
- // working tree is named "repo/.git" instead of "repo".
+ // Drop the trailing slash added above, or the "/.git" suffix test
+ // below never matches and a working tree is named "repo/.git".
if (relpath.len && relpath.buf[relpath.len - 1] == '/')
strbuf_setlen(&relpath, relpath.len - 1);
if (relpath.len >= 5 && !strcmp(relpath.buf + relpath.len - 5, "/.git"))