about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2016-10-11 08:55:34 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-10-12 14:13:10 +0200
commitc330a2e5f86e1f77d3b724877935e11014cefa21 (patch)
tree3d59a0bb69c7a65c537abbafe23c7afa9d78746e
parentshared: remove unused function strlpart() (diff)
downloadcgit-pink-c330a2e5f86e1f77d3b724877935e11014cefa21.tar.gz
cgit-pink-c330a2e5f86e1f77d3b724877935e11014cefa21.zip
ui-blog: fix oid handling
We have to use a pointer for walk_tree_ctx->matched_oid.

This fixes faulty commit 6e4b7b6776eb994e795fa38b2619db6c55e10ecc
(ui-blob: replace 'unsigned char sha1[20]' with 'struct object_id oid').
-rw-r--r--ui-blob.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ui-blob.c b/ui-blob.c
index 2f8bb7a..5f30de7 100644
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -13,7 +13,7 @@
 
 struct walk_tree_context {
 	const char *match_path;
-	struct object_id matched_oid;
+	struct object_id *matched_oid;
 	unsigned int found_path:1;
 	unsigned int file_only:1;
 };
@@ -28,7 +28,7 @@ static int walk_tree(const unsigned char *sha1, struct strbuf *base,
 	if (strncmp(base->buf, walk_tree_ctx->match_path, base->len)
 		|| strcmp(walk_tree_ctx->match_path + base->len, pathname))
 		return READ_TREE_RECURSIVE;
-	hashcpy(walk_tree_ctx->matched_oid.hash, sha1);
+	hashcpy(walk_tree_ctx->matched_oid->hash, sha1);
 	walk_tree_ctx->found_path = 1;
 	return 0;
 }
@@ -47,7 +47,7 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only)
 	};
 	struct walk_tree_context walk_tree_ctx = {
 		.match_path = path,
-		.matched_oid = oid,
+		.matched_oid = &oid,
 		.found_path = 0,
 		.file_only = file_only
 	};
@@ -77,7 +77,7 @@ int cgit_print_file(char *path, const char *head, int file_only)
 	};
 	struct walk_tree_context walk_tree_ctx = {
 		.match_path = path,
-		.matched_oid = oid,
+		.matched_oid = &oid,
 		.found_path = 0,
 		.file_only = file_only
 	};
@@ -120,7 +120,7 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl
 	};
 	struct walk_tree_context walk_tree_ctx = {
 		.match_path = path,
-		.matched_oid = oid,
+		.matched_oid = &oid,
 		.found_path = 0,
 		.file_only = file_only
 	};
n='3' class='logmsg'> 2024-10-12Add photos from October 6June McEnroe 2024-10-12Add photos from October 5June McEnroe 2024-10-09Add photos from October 1June McEnroe Ok the first 3 are from September 29 but I didn't want to spoil the black and white roll. 2024-10-07Add photos from September 29June McEnroe 2024-10-07Add photos from September 28June McEnroe 2024-10-07Add photos from September 22June McEnroe 2024-09-25Add photos from September 15June McEnroe 2024-09-24Add photos from September 14June McEnroe 2024-09-24Add photos from September 12June McEnroe 2024-09-24Add photos from September 7June McEnroe 2024-09-24Allow not having descriptionsJune McEnroe I'm sorry, I can't keep writing descriptions. It makes posting photos take too long, I often don't know the words for what I'm looking at, and a good description is an entirely different work of art than the photo I took, and I'm just a photographer. It's visual art. 2024-09-23Automatically select the last used lens for a bodyJune McEnroe 2024-09-19Add photos from September 5June McEnroe Had to prefix the folder number onto these file names manually because they must have come out of a different scanner or something. 2024-09-15Add some more film stocks to the listJune McEnroe 2024-09-13Add photos from September 2June McEnroe 2024-09-13Add Fomapan 200 to films listJune McEnroe 2024-09-10Add August 29 picnic photosJune McEnroe 2024-09-08Apply some bold to trips renderingJune McEnroe This seems easier to visually scan. The only other thing I'd like is a nicer date rendering but JavaScript is useless for that. 2024-09-08Render trips hopefully more efficientlyJune McEnroe 2024-09-08Allow removing bodies and lensesJune McEnroe 2024-09-08Limit body width so it looks less silly on desktopJune McEnroe 2024-09-07Handle no film being loadedJune McEnroe 2024-09-07Fancy up the text a littleJune McEnroe