Skip to content

Commit 42a3217

Browse files
torvaldsspearce
authored andcommitted
Avoid scary errors about tagged trees/blobs during git-fetch
Ok, what is going on is: - append_fetch_head() looks up the SHA1 for all heads (including tags): if (get_sha1(head, sha1)) return error("Not a valid object name: %s", head); - it then wants to check if it's a candidate for merging (because fetching also does the whole "list which heads to merge" in case it is going to be part of a "pull"): commit = lookup_commit_reference(sha1); if (!commit) not_for_merge = 1; - and that "lookup_commit_reference()" is just very vocal about the case where it fails. It really shouldn't be, and it shouldn't affect the actual end result, but that basically explains why you get that scary warning. In short, the warning is just bogus, and should be harmless, but I agree that it's ugly. I think the appended patch should fix it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 parent 1aa3d01 commit 42a3217

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-fetch--tool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static int append_fetch_head(FILE *fp,
148148

149149
if (get_sha1(head, sha1))
150150
return error("Not a valid object name: %s", head);
151-
commit = lookup_commit_reference(sha1);
151+
commit = lookup_commit_reference_gently(sha1, 1);
152152
if (!commit)
153153
not_for_merge = 1;
154154

0 commit comments

Comments
 (0)