about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui-patch.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/ui-patch.c b/ui-patch.c
index 4c051e8..fd6316b 100644
--- a/ui-patch.c
+++ b/ui-patch.c
@@ -16,7 +16,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
 {
 	struct rev_info rev;
 	struct commit *commit;
-	unsigned char new_rev_sha1[20], old_rev_sha1[20];
+	struct object_id new_rev_oid, old_rev_oid;
 	char rev_range[2 * 40 + 3];
 	char *rev_argv[] = { NULL, "--reverse", "--format=email", rev_range };
 	char *patchname;
@@ -24,12 +24,12 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
 	if (!new_rev)
 		new_rev = ctx.qry.head;
 
-	if (get_sha1(new_rev, new_rev_sha1)) {
+	if (get_oid(new_rev, &new_rev_oid)) {
 		cgit_print_error_page(404, "Not found",
 				"Bad object id: %s", new_rev);
 		return;
 	}
-	commit = lookup_commit_reference(new_rev_sha1);
+	commit = lookup_commit_reference(new_rev_oid.hash);
 	if (!commit) {
 		cgit_print_error_page(404, "Not found",
 				"Bad commit reference: %s", new_rev);
@@ -37,27 +37,27 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
 	}
 
 	if (old_rev) {
-		if (get_sha1(old_rev, old_rev_sha1)) {
+		if (get_oid(old_rev, &old_rev_oid)) {
 			cgit_print_error_page(404, "Not found",
 					"Bad object id: %s", old_rev);
 			return;
 		}
-		if (!lookup_commit_reference(old_rev_sha1)) {
+		if (!lookup_commit_reference(old_rev_oid.hash)) {
 			cgit_print_error_page(404, "Not found",
 					"Bad commit reference: %s", old_rev);
 			return;
 		}
 	} else if (commit->parents && commit->parents->item) {
-		hashcpy(old_rev_sha1, commit->parents->item->object.oid.hash);
+		oidcpy(&old_rev_oid, &commit->parents->item->object.oid);
 	} else {
-		hashclr(old_rev_sha1);
+		oidclr(&old_rev_oid);
 	}
 
-	if (is_null_sha1(old_rev_sha1)) {
-		memcpy(rev_range, sha1_to_hex(new_rev_sha1), 41);
+	if (is_null_oid(&old_rev_oid)) {
+		memcpy(rev_range, oid_to_hex(&new_rev_oid), GIT_SHA1_HEXSZ + 1);
 	} else {
-		sprintf(rev_range, "%s..%s", sha1_to_hex(old_rev_sha1),
-			sha1_to_hex(new_rev_sha1));
+		sprintf(rev_range, "%s..%s", oid_to_hex(&old_rev_oid),
+			oid_to_hex(&new_rev_oid));
 	}
 
 	patchname = fmt("%s.patch", rev_range);
20d09b4aec10ba6c&follow=1'>Move text "lexer" to hilex.cJune McEnroe 2021-01-13Try to return strings as single tokensJune McEnroe 2021-01-13Match [] as Operator in C lexerJune McEnroe 2021-01-13Fix C lexer to require a digit in a float literalJune McEnroe Otherwise ".l" is matched as Number. 2021-01-13Support long double in c.shJune McEnroe 2021-01-13Update Terminal.app coloursJune McEnroe God what is this garbage I only changed one colour. 2021-01-13Increase dark white brightness slightlyJune McEnroe 2021-01-13Add hilex example to htagml manualJune McEnroe 2021-01-12Style causal.agency like bin HTMLJune McEnroe 2021-01-12Avoid matching tag text inside HTML elementsJune McEnroe 2021-01-12Use hilex for up -hJune McEnroe 2021-01-12Use hilex for bin HTMLJune McEnroe 2021-01-12Don't output a pre in hilex by defaultJune McEnroe 2021-01-12Move hilex out of hilex directoryJune McEnroe 2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe God that makes the lexers so much simpler. 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe This simplifies some things, adds support for line number tag definitions, and should enable combining htagml with other preprocessors in the future. 2021-01-12Split fields by tab onlyJune McEnroe Also don't fail hard on non-forward-search definitions. 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe neovim is laggy as hell in my OpenBSD VM, so I switched to vi so I could type without getting frustrated. 2021-01-09Add c -t flag to print expression typeJune McEnroe Also add missing float case. 2021-01-05Update taglineJune McEnroe