Skip to content

Commit 0f487d3

Browse files
Pete Wyckoffgitster
authored andcommitted
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>
1 parent f629fa5 commit 0f487d3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

git-p4.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3163,6 +3163,7 @@ def run(self, args):
31633163
self.cloneExclude = ["/"+p for p in self.cloneExclude]
31643164
for p in depotPaths:
31653165
if not p.startswith("//"):
3166+
sys.stderr.write('Depot paths must start with "//": %s\n' % p)
31663167
return False
31673168

31683169
if not self.cloneDestination:

t/t9800-git-p4-basic.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ test_expect_success 'basic git p4 clone' '
3030
)
3131
'
3232

33+
test_expect_success 'depot typo error' '
34+
test_must_fail git p4 clone --dest="$git" /depot 2>errs &&
35+
grep "Depot paths must start with" errs
36+
'
37+
3338
test_expect_success 'git p4 clone @all' '
3439
git p4 clone --dest="$git" //depot@all &&
3540
test_when_finished cleanup_git &&

0 commit comments

Comments
 (0)