Skip to content

Commit 2c08b36

Browse files
sigprofJunio C Hamano
authored andcommitted
[PATCH] fetch.c: Remove call to parse_object() from process()
The call to parse_object() in process() is not actually needed - if the object type is unknown, parse_object() will be called by loop(); if the type is known, the object will be parsed by the appropriate process_*() function. After this change blobs which exist locally are no longer parsed, which gives about 2x CPU usage improvement; the downside is that there will be no warnings for existing corrupted blobs, but detecting such corruption is the job of git-fsck-objects, not the fetch programs. Newly fetched objects are still checked for corruption in http-fetch.c and ssh-fetch.c (local-fetch.c does not seem to do it, but the removed parse_object() call would not be reached for new objects anyway). Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 24451c3 commit 2c08b36

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

fetch.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ static int process(struct object *obj)
134134
obj->flags |= SEEN;
135135

136136
if (has_sha1_file(obj->sha1)) {
137-
parse_object(obj->sha1);
138137
/* We already have it, so we should scan it now. */
139138
obj->flags |= TO_SCAN;
140139
} else {

0 commit comments

Comments
 (0)