From 0375f472d484041f9b1e5550b57d69286b3322e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 24 Jun 2017 14:12:30 +0200 Subject: sha1_file: let for_each_file_in_obj_subdir() handle subdir names The function for_each_file_in_obj_subdir() takes a object subdirectory number and expects the name of the same subdirectory to be included in the path strbuf. Avoid this redundancy by letting the function append the hexadecimal subdirectory name itself. This makes it a bit easier and safer to use the function -- it becomes impossible to specify different subdirectories in subdir_nr and path. Suggested-by: Jeff King Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- sha1_name.c | 1 - 1 file changed, 1 deletion(-) (limited to 'sha1_name.c') diff --git a/sha1_name.c b/sha1_name.c index 76cb76a844..8de0e2d3b4 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -109,7 +109,6 @@ static void find_short_object_filename(struct disambiguate_state *ds) if (!alt->loose_objects_subdir_seen[subdir_nr]) { struct strbuf *buf = alt_scratch_buf(alt); - strbuf_addf(buf, "%02x/", subdir_nr); for_each_file_in_obj_subdir(subdir_nr, buf, append_loose_object, NULL, NULL, -- cgit v1.2.1