Skip to content

Commit

Permalink
Avoid scary errors about tagged trees/blobs during git-fetch
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shawn O. Pearce committed Oct 19, 2007
1 parent da0204d commit cfa5b2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions builtin-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ static int update_local_ref(struct ref *ref,
return s_update_ref("updating tag", ref, 0);
}

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

commit = lookup_commit_reference(rm->old_sha1);
commit = lookup_commit_reference_gently(rm->old_sha1, 1);
if (!commit)
rm->merge = 0;

Expand Down

0 comments on commit cfa5b2b

Please sign in to comment.