Skip to content

Commit 62335bb

Browse files
author
Eric Wong
committed
git-svn: shorten glob error message
Error messages should attempt to fit within the confines of an 80-column terminal to avoid compatibility and accessibility problems. Furthermore the word "directories" can be misleading when used in the context of git refnames. Signed-off-by: Eric Wong <[email protected]>
1 parent e4e5dd9 commit 62335bb

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

perl/Git/SVN/GlobSpec.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ sub new {
88
$re =~ s!/+$!!g; # no need for trailing slashes
99
my (@left, @right, @patterns);
1010
my $state = "left";
11-
my $die_msg = "Only one set of wildcard directories " .
12-
"(e.g. '*' or '*/*/*') is supported: '$glob'\n";
11+
my $die_msg = "Only one set of wildcards " .
12+
"(e.g. '*' or '*/*/*') is supported: $glob\n";
1313
for my $part (split(m|/|, $glob)) {
1414
if ($pattern_ok && $part =~ /[{}]/ &&
1515
$part !~ /^\{[^{}]+\}/) {

t/t9108-git-svn-glob.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,12 @@ test_expect_success 'test left-hand-side only globbing' '
8686
test_cmp expect.two output.two
8787
'
8888

89-
echo "Only one set of wildcard directories" \
90-
"(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'" > expect.three
91-
echo "" >> expect.three
89+
test_expect_success 'prepare test disallow multi-globs' "
90+
cat >expect.three <<EOF
91+
Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*
92+
93+
EOF
94+
"
9295

9396
test_expect_success 'test disallow multi-globs' '
9497
git config --add svn-remote.three.url "$svnrepo" &&

t/t9109-git-svn-multi-glob.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,12 @@ test_expect_success 'test another branch' '
135135
test_cmp expect.four output.four
136136
'
137137

138-
echo "Only one set of wildcard directories" \
139-
"(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'" > expect.three
140-
echo "" >> expect.three
138+
test_expect_success 'prepare test disallow multiple globs' "
139+
cat >expect.three <<EOF
140+
Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*
141+
142+
EOF
143+
"
141144

142145
test_expect_success 'test disallow multiple globs' '
143146
git config --add svn-remote.three.url "$svnrepo" &&

t/t9168-git-svn-partially-globbed-names.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ test_expect_success 'test prefixed globs match just prefix' '
130130
'
131131

132132
test_expect_success 'prepare test disallow prefixed multi-globs' "
133-
echo \"Only one set of wildcard directories\" \
134-
\"(e.g. '*' or '*/*/*') is supported: 'branches/b_*/t/*'\" >expect.four &&
135-
echo \"\" >>expect.four
133+
cat >expect.four <<EOF
134+
Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/b_*/t/*
135+
136+
EOF
136137
"
137138

138139
test_expect_success 'test disallow prefixed multi-globs' '

0 commit comments

Comments
 (0)