connect: factor out "looks like command line option" check
commit2491f77b90c2e5d47acbe7472c17e7de0af74f63
authorJeff King <peff@peff.net>
Fri, 28 Jul 2017 19:25:45 +0000 (28 15:25 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Jul 2017 22:51:56 +0000 (28 15:51 -0700)
treeba20f55e5f188c839bb952f7b1a8428c370f9374
parent2d90add5ad216807ec1433e5367fae730e74a4cb
connect: factor out "looks like command line option" check

We reject hostnames that start with a dash because they may
be confused for command-line options. Let's factor out that
notion into a helper function, as we'll use it in more
places. And while it's simple now, it's not clear if some
systems might need more complex logic to handle all cases.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
connect.c
path.c