Code

Fix a crash in ls-remote when refspec expands into nothing
authorAlex Riesen <raa.lkml@gmail.com>
Fri, 12 Oct 2007 20:40:04 +0000 (22:40 +0200)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 16 Oct 2007 00:40:50 +0000 (20:40 -0400)
Originally-by: Väinö Järvelä <v@pp.inet.fi>
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
remote.c

index e2ca4d32bab79f2d3795fa8cbc6a70906c672f0e..b20e2be4332b3b4a17c50988f2acdcd80834a6f7 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -909,7 +909,8 @@ int get_fetch_map(struct ref *remote_refs,
                            rm->peer_ref->name);
        }
 
-       tail_link_ref(ref_map, tail);
+       if (ref_map)
+               tail_link_ref(ref_map, tail);
 
        return 0;
 }