Skip to content

Commit cfa5b2b

Browse files
committed
Avoid scary errors about tagged trees/blobs during git-fetch
This is the same bug as 42a3217. The warning "Object $X is a tree, not a commit" is bogus and is not relevant here. If its not a commit we just need to make sure we don't mark it for merge as we fill out FETCH_HEAD. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 parent da0204d commit cfa5b2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builtin-fetch.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ static int update_local_ref(struct ref *ref,
202202
return s_update_ref("updating tag", ref, 0);
203203
}
204204

205-
current = lookup_commit_reference(ref->old_sha1);
206-
updated = lookup_commit_reference(ref->new_sha1);
205+
current = lookup_commit_reference_gently(ref->old_sha1, 1);
206+
updated = lookup_commit_reference_gently(ref->new_sha1, 1);
207207
if (!current || !updated) {
208208
char *msg;
209209
if (!strncmp(ref->name, "refs/tags/", 10))
@@ -261,7 +261,7 @@ static void store_updated_refs(const char *url, struct ref *ref_map)
261261
ref->force = rm->peer_ref->force;
262262
}
263263

264-
commit = lookup_commit_reference(rm->old_sha1);
264+
commit = lookup_commit_reference_gently(rm->old_sha1, 1);
265265
if (!commit)
266266
rm->merge = 0;
267267

0 commit comments

Comments
 (0)