Skip to content

Commit 788a557

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 <[email protected]>
1 parent 0945545 commit 788a557

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
@@ -95,6 +95,9 @@ static void gh_client__update_loose_cache(const char *line)
9595
if (!skip_prefix(line, "loose ", &v1_oid))
9696
BUG("update_loose_cache: invalid line '%s'", line);
9797

98+
if (get_oid_hex(v1_oid, &oid))
99+
BUG("update_loose_cache: invalid line '%s'", line);
100+
98101
odb_loose_cache_add_new_oid(gh_client__chosen_odb, &oid);
99102
}
100103

0 commit comments

Comments
 (0)