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 <normalperson@yhbt.net>
Eric Wong committed
Jan 14, 2016 at 03:59 UTC
62335bbbc747c96636b5ce9917b156304c732eaf
4 files changed
+18
-11
perl/Git/SVN/GlobSpec.pm
+2
-2
@@ -8,8 +8,8 @@ sub new {
8
$re =~ s!/+$!!g; # no need for trailing slashes
9
my (@left, @right, @patterns);
10
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";
13
for my $part (split(m|/|, $glob)) {
14
if ($pattern_ok && $part =~ /[{}]/ &&
15
$part !~ /^\{[^{}]+\}/) {
t/t9108-git-svn-glob.sh
+6
-3
@@ -86,9 +86,12 @@ test_expect_success 'test left-hand-side only globbing' '
86
test_cmp expect.two output.two
87
'
88
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
+ "
95
96
test_expect_success 'test disallow multi-globs' '
97
git config --add svn-remote.three.url "$svnrepo" &&
t/t9109-git-svn-multi-glob.sh
+6
-3
@@ -135,9 +135,12 @@ test_expect_success 'test another branch' '
135
test_cmp expect.four output.four
136
'
137
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
+ "
144
145
test_expect_success 'test disallow multiple globs' '
146
git config --add svn-remote.three.url "$svnrepo" &&
t/t9168-git-svn-partially-globbed-names.sh
+4
-3
@@ -130,9 +130,10 @@ test_expect_success 'test prefixed globs match just prefix' '
130
'
131
132
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
137
"
138
139
test_expect_success 'test disallow prefixed multi-globs' '