Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2008-08-26 23:32:37 +0400
committerEric Wong <normalperson@yhbt.net>2008-09-06 03:58:39 +0400
commit05427b91f0b5e45688cbea21faf0f2d79ec07b21 (patch)
tree7951ab6f2dbdc5d888b2ec7330230203bcfb6d14 /t/t9119-git-svn-info.sh
parentedde9112abd1ef5f4565468e8a9a500e0c03f900 (diff)
git svn info: always quote URLs in 'info' output
Changes 'git svn info' to always URL-escape the 'URL' and 'Repository' fields and --url output, like SVN (at least 1.5) does. Note that reusing the escape_url() further down in Git::SVN::Ra is not possible because it only triggers for http(s) URLs. I did not know whether extending it to all schemes would break SVN access anywhere, so I made a new one that quotes in all schemes. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 't/t9119-git-svn-info.sh')
-rwxr-xr-xt/t9119-git-svn-info.sh30
1 files changed, 16 insertions, 14 deletions
diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh
index 8709bcc49c..181101010f 100755
--- a/t/t9119-git-svn-info.sh
+++ b/t/t9119-git-svn-info.sh
@@ -34,6 +34,8 @@ ptouch() {
' "`svn info $2 | grep '^Text Last Updated:'`" "$1"
}
+quoted_svnrepo="$(echo $svnrepo | sed 's/ /%20/')"
+
test_expect_success 'setup repository and import' '
mkdir info &&
cd info &&
@@ -70,7 +72,7 @@ test_expect_success 'info' "
"
test_expect_success 'info --url' '
- test "$(cd gitwc; git-svn info --url)" = "$svnrepo"
+ test "$(cd gitwc; git-svn info --url)" = "$quoted_svnrepo"
'
test_expect_success 'info .' "
@@ -80,7 +82,7 @@ test_expect_success 'info .' "
"
test_expect_success 'info --url .' '
- test "$(cd gitwc; git-svn info --url .)" = "$svnrepo"
+ test "$(cd gitwc; git-svn info --url .)" = "$quoted_svnrepo"
'
test_expect_success 'info file' "
@@ -90,7 +92,7 @@ test_expect_success 'info file' "
"
test_expect_success 'info --url file' '
- test "$(cd gitwc; git-svn info --url file)" = "$svnrepo/file"
+ test "$(cd gitwc; git-svn info --url file)" = "$quoted_svnrepo/file"
'
test_expect_success 'info directory' "
@@ -106,7 +108,7 @@ test_expect_success 'info inside directory' "
"
test_expect_success 'info --url directory' '
- test "$(cd gitwc; git-svn info --url directory)" = "$svnrepo/directory"
+ test "$(cd gitwc; git-svn info --url directory)" = "$quoted_svnrepo/directory"
'
test_expect_success 'info symlink-file' "
@@ -117,7 +119,7 @@ test_expect_success 'info symlink-file' "
test_expect_success 'info --url symlink-file' '
test "$(cd gitwc; git-svn info --url symlink-file)" \
- = "$svnrepo/symlink-file"
+ = "$quoted_svnrepo/symlink-file"
'
test_expect_success 'info symlink-directory' "
@@ -130,7 +132,7 @@ test_expect_success 'info symlink-directory' "
test_expect_success 'info --url symlink-directory' '
test "$(cd gitwc; git-svn info --url symlink-directory)" \
- = "$svnrepo/symlink-directory"
+ = "$quoted_svnrepo/symlink-directory"
'
test_expect_success 'info added-file' "
@@ -150,7 +152,7 @@ test_expect_success 'info added-file' "
test_expect_success 'info --url added-file' '
test "$(cd gitwc; git-svn info --url added-file)" \
- = "$svnrepo/added-file"
+ = "$quoted_svnrepo/added-file"
'
test_expect_success 'info added-directory' "
@@ -172,7 +174,7 @@ test_expect_success 'info added-directory' "
test_expect_success 'info --url added-directory' '
test "$(cd gitwc; git-svn info --url added-directory)" \
- = "$svnrepo/added-directory"
+ = "$quoted_svnrepo/added-directory"
'
test_expect_success 'info added-symlink-file' "
@@ -195,7 +197,7 @@ test_expect_success 'info added-symlink-file' "
test_expect_success 'info --url added-symlink-file' '
test "$(cd gitwc; git-svn info --url added-symlink-file)" \
- = "$svnrepo/added-symlink-file"
+ = "$quoted_svnrepo/added-symlink-file"
'
test_expect_success 'info added-symlink-directory' "
@@ -218,7 +220,7 @@ test_expect_success 'info added-symlink-directory' "
test_expect_success 'info --url added-symlink-directory' '
test "$(cd gitwc; git-svn info --url added-symlink-directory)" \
- = "$svnrepo/added-symlink-directory"
+ = "$quoted_svnrepo/added-symlink-directory"
'
# The next few tests replace the "Text Last Updated" value with a
@@ -244,7 +246,7 @@ test_expect_success 'info deleted-file' "
test_expect_success 'info --url file (deleted)' '
test "$(cd gitwc; git-svn info --url file)" \
- = "$svnrepo/file"
+ = "$quoted_svnrepo/file"
'
test_expect_success 'info deleted-directory' "
@@ -265,7 +267,7 @@ test_expect_success 'info deleted-directory' "
test_expect_success 'info --url directory (deleted)' '
test "$(cd gitwc; git-svn info --url directory)" \
- = "$svnrepo/directory"
+ = "$quoted_svnrepo/directory"
'
test_expect_success 'info deleted-symlink-file' "
@@ -287,7 +289,7 @@ test_expect_success 'info deleted-symlink-file' "
test_expect_success 'info --url symlink-file (deleted)' '
test "$(cd gitwc; git-svn info --url symlink-file)" \
- = "$svnrepo/symlink-file"
+ = "$quoted_svnrepo/symlink-file"
'
test_expect_success 'info deleted-symlink-directory' "
@@ -309,7 +311,7 @@ test_expect_success 'info deleted-symlink-directory' "
test_expect_success 'info --url symlink-directory (deleted)' '
test "$(cd gitwc; git-svn info --url symlink-directory)" \
- = "$svnrepo/symlink-directory"
+ = "$quoted_svnrepo/symlink-directory"
'
# NOTE: git does not have the concept of replaced objects,