summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-09-18 08:54:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-09-19 10:22:31 (GMT)
commit27e13374bf1864eb8aea44cca3afd81eedb007aa (patch)
tree3feeec80a9e1c61877427411ee9cd7a63e83eef0 /remote.c
parentf38395905b3d49bd68e0c01ca2310bf3387e1063 (diff)
downloadgit-27e13374bf1864eb8aea44cca3afd81eedb007aa.zip
git-27e13374bf1864eb8aea44cca3afd81eedb007aa.tar.gz
git-27e13374bf1864eb8aea44cca3afd81eedb007aa.tar.bz2
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 <spearce@spearce.org>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/remote.c b/remote.c
index 73a34c9..af3c46b 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;
}