Skip to content

Commit 43b82bd

Browse files
Pete Wyckoffgitster
authored andcommitted
git-p4: only a single ... wildcard is supported
Catch the case where a ... exists at the end, and also elsehwere. Reported-by: Gary Gibbons <ggibbons@perforce.com> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 896a681 commit 43b82bd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

contrib/fast-import/git-p4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,8 @@ class View(object):
12071207
die("Can't handle * wildcards in view: %s" % self.path)
12081208
triple_dot_index = self.path.find("...")
12091209
if triple_dot_index >= 0:
1210-
if not self.path.endswith("..."):
1211-
die("Can handle ... wildcard only at end of path: %s" %
1210+
if triple_dot_index != len(self.path) - 3:
1211+
die("Can handle only single ... wildcard, at end: %s" %
12121212
self.path)
12131213
self.ends_triple_dot = True
12141214

t/t9809-git-p4-client-view.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,18 @@ test_expect_success 'unsupported view wildcard *' '
101101
test_must_fail "$GITP4" clone --use-client-spec --dest="$git" //depot
102102
'
103103

104-
test_expect_success 'wildcard ... only supported at end of spec' '
104+
test_expect_success 'wildcard ... only supported at end of spec 1' '
105105
client_view "//depot/.../file11 //client/.../file11" &&
106106
test_when_finished cleanup_git &&
107107
test_must_fail "$GITP4" clone --use-client-spec --dest="$git" //depot
108108
'
109109

110+
test_expect_success 'wildcard ... only supported at end of spec 2' '
111+
client_view "//depot/.../a/... //client/.../a/..." &&
112+
test_when_finished cleanup_git &&
113+
test_must_fail "$GITP4" clone --use-client-spec --dest="$git" //depot
114+
'
115+
110116
test_expect_success 'basic map' '
111117
client_view "//depot/dir1/... //client/cli1/..." &&
112118
files="cli1/file11 cli1/file12" &&

0 commit comments

Comments
 (0)