From: Shawn O. Pearce Date: Tue, 18 Sep 2007 08:54:48 +0000 (-0400) Subject: builtin-fetch: Don't segfault on "fetch +foo" X-Git-Tag: v1.5.4-rc0~325^2~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=27e13374bf1864eb8aea44cca3afd81eedb007aa;p=thirdparty%2Fgit.git builtin-fetch: Don't segfault on "fetch +foo" 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 --- diff --git a/remote.c b/remote.c index 73a34c9e36..af3c46bb35 100644 --- a/remote.c +++ b/remote.c @@ -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; }