@matheusbsbs / matheus-bagliano / commits / cfa5b2b7fa
Fork 0

Avoid scary errors about tagged trees/blobs during git-fetch

This is the same bug as 42a32174b600f139b489341b1281fb1bfa14c252. 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>

Shawn O. Pearce committed Oct 19, 2007 at 00:54 UTC cfa5b2b7faa1a620ec6599a63fa5b9b45bd62b57
1 file changed +3 -3
builtin-fetch.c
+3 -3
@@ -202,8 +202,8 @@ static int update_local_ref(struct ref *ref,
202 return s_update_ref("updating tag", ref, 0);
203 }
204
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);
207 if (!current || !updated) {
208 char *msg;
209 if (!strncmp(ref->name, "refs/tags/", 10))
@@ -261,7 +261,7 @@ static void store_updated_refs(const char *url, struct ref *ref_map)
261 ref->force = rm->peer_ref->force;
262 }
263
264 - commit = lookup_commit_reference(rm->old_sha1);
264 + commit = lookup_commit_reference_gently(rm->old_sha1, 1);
265 if (!commit)
266 rm->merge = 0;
267