Skip to content

Commit

Permalink
builtin-fetch: Don't segfault on "fetch +foo"
Browse files Browse the repository at this point in the history
If we are fetching something and were configured to do a forced
fetch and have no local ref to store the fetched object into we
cannot mark the local ref as having a forced update.  Instead we
should just silently discard the + request.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Sep 19, 2007
1 parent f383959 commit 27e1337
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,7 @@ int get_fetch_map(struct ref *remote_refs,
refspec->src : "HEAD");

ref_map->peer_ref = get_local_ref(refspec->dst);

if (refspec->force)
if (ref_map->peer_ref && refspec->force)
ref_map->peer_ref->force = 1;
}

Expand Down

0 comments on commit 27e1337

Please sign in to comment.