Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Drop ui-blob's constant file_only arguments
Diffstat (limited to '')
| -rw-r--r-- | source/cgit.c | 2 | |
| -rw-r--r-- | source/cmd.c | 2 | |
| -rw-r--r-- | source/ui-blob.c | 12 | |
| -rw-r--r-- | source/ui-blob.h | 6 | |
| -rw-r--r-- | source/ui-summary.c | 4 |
5 files changed, 13 insertions, 13 deletions
diff --git a/source/cgit.c b/source/cgit.c index 2bb761d..a746a83 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -1006,7 +1006,7 @@ static void choose_readme(struct cgit_repo *repo) continue; } if (ref) { - if (cgit_ref_path_exists(filename, ref, 1)) { + if (cgit_ref_path_exists(filename, ref)) { found = 1; break; } diff --git a/source/cmd.c b/source/cmd.c index 894649e..3fd393b 100644 --- a/source/cmd.c +++ b/source/cmd.c @@ -69,7 +69,7 @@ static void blame_fn(void) static void blob_fn(void) { - cgit_print_blob(ctx.qry.oid, ctx.qry.path, ctx.qry.head, 0); + cgit_print_blob(ctx.qry.oid, ctx.qry.path, ctx.qry.head); } static void commit_fn(void) diff --git a/source/ui-blob.c b/source/ui-blob.c index 948b348..bc66509 100644 --- a/source/ui-blob.c +++ b/source/ui-blob.c @@ -91,7 +91,7 @@ static int find_path_oid(struct object_id *oid, char *path, int file_only) return walk.found_path; } -int cgit_ref_path_exists(const char *path, const char *ref, int file_only) +int cgit_ref_path_exists(const char *path, const char *ref) { struct object_id oid; size_t size; @@ -103,14 +103,14 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only) peel_to_commit(&oid); if (odb_read_object_info(the_repository->objects, &oid, &size) != OBJ_COMMIT) goto done; - found = find_path_oid(&oid, path_copy, file_only); + found = find_path_oid(&oid, path_copy, 1); done: free(path_copy); return found; } -int cgit_print_file(char *path, const char *head, int file_only, int html_escape) +int cgit_print_file(char *path, const char *head, int html_escape) { struct object_id oid; enum object_type type; @@ -122,7 +122,7 @@ int cgit_print_file(char *path, const char *head, int file_only, int html_escape peel_to_commit(&oid); type = odb_read_object_info(the_repository->objects, &oid, &size); if (type == OBJ_COMMIT) { - if (!find_path_oid(&oid, path, file_only)) + if (!find_path_oid(&oid, path, 1)) return -1; type = odb_read_object_info(the_repository->objects, &oid, &size); } @@ -157,7 +157,7 @@ int cgit_print_file(char *path, const char *head, int file_only, int html_escape return 0; } -void cgit_print_blob(const char *hex, char *path, const char *head, int file_only) +void cgit_print_blob(const char *hex, char *path, const char *head) { struct object_id oid; enum object_type type; @@ -186,7 +186,7 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl } if (type == OBJ_COMMIT && path) { - if (!find_path_oid(&oid, path, file_only)) { + if (!find_path_oid(&oid, path, 0)) { cgit_print_error_page(404, "Not Found", "Path not found: %s", path); return; } diff --git a/source/ui-blob.h b/source/ui-blob.h index 2c10c55..4f8597b 100644 --- a/source/ui-blob.h +++ b/source/ui-blob.h @@ -8,15 +8,15 @@ #ifndef CGIT_UI_BLOB_H #define CGIT_UI_BLOB_H -extern int cgit_ref_path_exists(const char *path, const char *ref, int file_only); +extern int cgit_ref_path_exists(const char *path, const char *ref); /* * Write the file at path in head, escaped when html_escape is set. The return * is 0 once it is written, -2 when it is past max-blob-size, and -1 when it * cannot be found or read. */ -extern int cgit_print_file(char *path, const char *head, int file_only, int html_escape); +extern int cgit_print_file(char *path, const char *head, int html_escape); -extern void cgit_print_blob(const char *hex, char *path, const char *head, int file_only); +extern void cgit_print_blob(const char *hex, char *path, const char *head); #endif // CGIT_UI_BLOB_H diff --git a/source/ui-summary.c b/source/ui-summary.c index f37650d..ea31a9e 100644 --- a/source/ui-summary.c +++ b/source/ui-summary.c @@ -96,7 +96,7 @@ void cgit_print_repo_readme(void) // into safe HTML, so it is escaped rather than served raw. html("<pre class='plaintext'>"); if (ref) { - err = cgit_print_file(filename, ref, 1, 1); + err = cgit_print_file(filename, ref, 1); } else { struct strbuf sb = STRBUF_INIT; if (strbuf_read_file(&sb, filename, 0) >= 0) @@ -115,7 +115,7 @@ void cgit_print_repo_readme(void) // through unescaped. cgit_open_filter(ctx.repo->about_filter, filename, tree_base.buf, tree_query.buf); if (ref) - err = cgit_print_file(filename, ref, 1, 0); + err = cgit_print_file(filename, ref, 0); else html_include(filename); cgit_close_filter(ctx.repo->about_filter); |
