Skip to content

Commit a98ea5a

Browse files
jeffhostetlerdscho
authored andcommitted
gvfs-helper-client: properly update loose cache with fetched OID
Fix parsing of the "loose <odb>" response from `gvfs-helper` and use the actually parsed OID when updating the loose oid cache. Previously, an uninitialized "struct oid" was used to update the cache. This did not cause any corruption, but could cause extra fetches for objects visited multiple times. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
1 parent e684ee3 commit a98ea5a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gvfs-helper-client.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ static void gh_client__update_loose_cache(const char *line)
9393
if (!skip_prefix(line, "loose ", &v1_oid))
9494
BUG("update_loose_cache: invalid line '%s'", line);
9595

96+
if (get_oid_hex(v1_oid, &oid))
97+
BUG("update_loose_cache: invalid line '%s'", line);
98+
9699
odb_loose_cache_add_new_oid(gh_client__chosen_odb, &oid);
97100
}
98101

0 commit comments

Comments
 (0)