git p4: generate better error message for bad depot path
Depot paths must start with //. Exit with a better explanation when a bad depot path is supplied. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
f629fa597c
commit
0f487d308d
@ -3163,6 +3163,7 @@ class P4Clone(P4Sync):
|
|||||||
self.cloneExclude = ["/"+p for p in self.cloneExclude]
|
self.cloneExclude = ["/"+p for p in self.cloneExclude]
|
||||||
for p in depotPaths:
|
for p in depotPaths:
|
||||||
if not p.startswith("//"):
|
if not p.startswith("//"):
|
||||||
|
sys.stderr.write('Depot paths must start with "//": %s\n' % p)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not self.cloneDestination:
|
if not self.cloneDestination:
|
||||||
|
@ -30,6 +30,11 @@ test_expect_success 'basic git p4 clone' '
|
|||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'depot typo error' '
|
||||||
|
test_must_fail git p4 clone --dest="$git" /depot 2>errs &&
|
||||||
|
grep "Depot paths must start with" errs
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'git p4 clone @all' '
|
test_expect_success 'git p4 clone @all' '
|
||||||
git p4 clone --dest="$git" //depot@all &&
|
git p4 clone --dest="$git" //depot@all &&
|
||||||
test_when_finished cleanup_git &&
|
test_when_finished cleanup_git &&
|
||||||
|
Loading…
Reference in New Issue
Block a user