Skip to content

Commit b611189

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 5021407 commit b611189

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

94+
if (get_oid_hex(v1_oid, &oid))
95+
BUG("update_loose_cache: invalid line '%s'", line);
96+
9497
odb_loose_cache_add_new_oid(gh_client__chosen_odb, &oid);
9598
}
9699

0 commit comments

Comments
 (0)