diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Align with spaces instead of tabs
Diffstat (limited to '')
-rw-r--r--source/cgit.c25
1 file changed, 12 insertions, 13 deletions
diff --git a/source/cgit.c b/source/cgit.c
index 00ce97f..8601dd0 100644
--- a/source/cgit.c
+++ b/source/cgit.c
@@ -384,9 +384,9 @@ static int generate_cached_repolist(const char *path, const char *cached_rc)
// list, and once the path is confirmed to still name this file that
// rename can no longer happen, because it takes the lock held here.
if (
- fstat(fd, &held) ||
- stat(locked_rc.buf, &named) ||
- held.st_ino != named.st_ino ||
+ fstat(fd, &held) ||
+ stat(locked_rc.buf, &named) ||
+ held.st_ino != named.st_ino ||
held.st_dev != named.st_dev
) {
err = EAGAIN;
@@ -844,10 +844,10 @@ static void authenticate_cookie(void)
}
if (
- ctx.env.request_method &&
- ctx.qry.page &&
- !ctx.repo &&
- !strcmp(ctx.env.request_method, "POST") &&
+ ctx.env.request_method &&
+ ctx.qry.page &&
+ !ctx.repo &&
+ !strcmp(ctx.env.request_method, "POST") &&
!strcmp(ctx.qry.page, "login")
) {
authenticate_post();
@@ -921,9 +921,9 @@ static int calc_ttl(void)
// object id can never come out differently and is the most expensive
// page to rebuild.
if (
- ctx.qry.has_oid &&
- page_is_static() &&
- (!ctx.qry.oid || is_full_oid(ctx.qry.oid)) &&
+ ctx.qry.has_oid &&
+ page_is_static() &&
+ (!ctx.qry.oid || is_full_oid(ctx.qry.oid)) &&
(!ctx.qry.oid2 || is_full_oid(ctx.qry.oid2))
)
return ctx.cfg.cache_static_ttl;
@@ -1157,7 +1157,7 @@ static int prepare_repo_cmd(int nongit, int err, int clone)
return 1;
}
if (
- (ctx.qry.oid && !cgit_valid_rev(ctx.qry.oid)) ||
+ (ctx.qry.oid && !cgit_valid_rev(ctx.qry.oid)) ||
(ctx.qry.oid2 && !cgit_valid_rev(ctx.qry.oid2))
) {
cgit_print_error_page(400, "Bad Request", "Invalid revision");
@@ -1354,8 +1354,7 @@ int cmd_main(int argc, const char **argv)
ttl = calc_ttl();
// An unauthenticated request gets a body meant for one visitor, and a
// HEAD request stops after the headers.
- if (!ctx.env.authenticated ||
- (ctx.env.request_method && !strcmp(ctx.env.request_method, "HEAD")))
+ if (!ctx.env.authenticated || (ctx.env.request_method && !strcmp(ctx.env.request_method, "HEAD")))
ctx.cfg.cache_size = 0;
build_cache_key(&cache_key);