summaryrefslogtreecommitdiff
path: root/revision.h
diff options
context:
space:
mode:
authorLibravatar Patrick Steinhardt <ps@pks.im>2015-08-10 17:48:23 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-08-10 11:01:08 -0700
commite895986727dfc4105c497132540dafa8ed51ec0a (patch)
tree15b88bc28cc0b417f95fa7944a081cf939294a9c /revision.h
parentclone: use computed length in guess_dir_name (diff)
downloadtgif-e895986727dfc4105c497132540dafa8ed51ec0a.tar.xz
clone: do not include authentication data in guessed dir
If the URI contains authentication data and the URI's path component is empty, we fail to guess a sensible directory name. E.g. cloning a repository 'ssh://user:password@example.com/' we guess a directory name 'password@example.com' where we would want the hostname only, e.g. 'example.com'. The naive way of just adding '@' as a path separator would break cloning repositories like 'foo/bar@baz.git' (which would currently become 'bar@baz' but would then become 'baz' only). Instead fix this by first dropping the scheme and then greedily scanning for an '@' sign until we find the first path separator. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.h')
0 files changed, 0 insertions, 0 deletions