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>
This commit is contained in:
parent
e4e5dd94e6
commit
62335bbbc7
@ -8,8 +8,8 @@ sub new {
|
|||||||
$re =~ s!/+$!!g; # no need for trailing slashes
|
$re =~ s!/+$!!g; # no need for trailing slashes
|
||||||
my (@left, @right, @patterns);
|
my (@left, @right, @patterns);
|
||||||
my $state = "left";
|
my $state = "left";
|
||||||
my $die_msg = "Only one set of wildcard directories " .
|
my $die_msg = "Only one set of wildcards " .
|
||||||
"(e.g. '*' or '*/*/*') is supported: '$glob'\n";
|
"(e.g. '*' or '*/*/*') is supported: $glob\n";
|
||||||
for my $part (split(m|/|, $glob)) {
|
for my $part (split(m|/|, $glob)) {
|
||||||
if ($pattern_ok && $part =~ /[{}]/ &&
|
if ($pattern_ok && $part =~ /[{}]/ &&
|
||||||
$part !~ /^\{[^{}]+\}/) {
|
$part !~ /^\{[^{}]+\}/) {
|
||||||
|
@ -86,9 +86,12 @@ test_expect_success 'test left-hand-side only globbing' '
|
|||||||
test_cmp expect.two output.two
|
test_cmp expect.two output.two
|
||||||
'
|
'
|
||||||
|
|
||||||
echo "Only one set of wildcard directories" \
|
test_expect_success 'prepare test disallow multi-globs' "
|
||||||
"(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'" > expect.three
|
cat >expect.three <<EOF
|
||||||
echo "" >> expect.three
|
Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*
|
||||||
|
|
||||||
|
EOF
|
||||||
|
"
|
||||||
|
|
||||||
test_expect_success 'test disallow multi-globs' '
|
test_expect_success 'test disallow multi-globs' '
|
||||||
git config --add svn-remote.three.url "$svnrepo" &&
|
git config --add svn-remote.three.url "$svnrepo" &&
|
||||||
|
@ -135,9 +135,12 @@ test_expect_success 'test another branch' '
|
|||||||
test_cmp expect.four output.four
|
test_cmp expect.four output.four
|
||||||
'
|
'
|
||||||
|
|
||||||
echo "Only one set of wildcard directories" \
|
test_expect_success 'prepare test disallow multiple globs' "
|
||||||
"(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'" > expect.three
|
cat >expect.three <<EOF
|
||||||
echo "" >> expect.three
|
Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*
|
||||||
|
|
||||||
|
EOF
|
||||||
|
"
|
||||||
|
|
||||||
test_expect_success 'test disallow multiple globs' '
|
test_expect_success 'test disallow multiple globs' '
|
||||||
git config --add svn-remote.three.url "$svnrepo" &&
|
git config --add svn-remote.three.url "$svnrepo" &&
|
||||||
|
@ -130,9 +130,10 @@ test_expect_success 'test prefixed globs match just prefix' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'prepare test disallow prefixed multi-globs' "
|
test_expect_success 'prepare test disallow prefixed multi-globs' "
|
||||||
echo \"Only one set of wildcard directories\" \
|
cat >expect.four <<EOF
|
||||||
\"(e.g. '*' or '*/*/*') is supported: 'branches/b_*/t/*'\" >expect.four &&
|
Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/b_*/t/*
|
||||||
echo \"\" >>expect.four
|
|
||||||
|
EOF
|
||||||
"
|
"
|
||||||
|
|
||||||
test_expect_success 'test disallow prefixed multi-globs' '
|
test_expect_success 'test disallow prefixed multi-globs' '
|
||||||
|
Loading…
Reference in New Issue
Block a user