Imported Upstream version 2.11.0
[platform/upstream/git.git] / t / t9119-git-svn-info.sh
index ff19695..88241ba 100755 (executable)
@@ -8,7 +8,7 @@ test_description='git svn info'
 
 # Tested with: svn, version 1.4.4 (r25188)
 # Tested with: svn, version 1.6.[12345689]
-v=`svn_cmd --version | sed -n -e 's/^svn, version \(1\.[0-9]*\.[0-9]*\).*$/\1/p'`
+v=$(svn_cmd --version | sed -n -e 's/^svn, version \(1\.[0-9]*\.[0-9]*\).*$/\1/p')
 case $v in
 1.[456].*)
        ;;
@@ -74,6 +74,36 @@ test_expect_success 'info .' "
        test_cmp_info expected.info-dot actual.info-dot
        "
 
+test_expect_success 'info $(pwd)' '
+       (cd svnwc; svn info "$(pwd)") >expected.info-pwd &&
+       (cd gitwc; git svn info "$(pwd)") >actual.info-pwd &&
+       grep -v ^Path: <expected.info-pwd >expected.info-np &&
+       grep -v ^Path: <actual.info-pwd >actual.info-np &&
+       test_cmp_info expected.info-np actual.info-np &&
+       test "$(sed -ne \"/^Path:/ s!/svnwc!!\" <expected.info-pwd)" = \
+            "$(sed -ne \"/^Path:/ s!/gitwc!!\" <actual.info-pwd)"
+       '
+
+test_expect_success 'info $(pwd)/../___wc' '
+       (cd svnwc; svn info "$(pwd)/../svnwc") >expected.info-pwd &&
+       (cd gitwc; git svn info "$(pwd)/../gitwc") >actual.info-pwd &&
+       grep -v ^Path: <expected.info-pwd >expected.info-np &&
+       grep -v ^Path: <actual.info-pwd >actual.info-np &&
+       test_cmp_info expected.info-np actual.info-np &&
+       test "$(sed -ne \"/^Path:/ s!/svnwc!!\" <expected.info-pwd)" = \
+            "$(sed -ne \"/^Path:/ s!/gitwc!!\" <actual.info-pwd)"
+       '
+
+test_expect_success 'info $(pwd)/../___wc//file' '
+       (cd svnwc; svn info "$(pwd)/../svnwc//file") >expected.info-pwd &&
+       (cd gitwc; git svn info "$(pwd)/../gitwc//file") >actual.info-pwd &&
+       grep -v ^Path: <expected.info-pwd >expected.info-np &&
+       grep -v ^Path: <actual.info-pwd >actual.info-np &&
+       test_cmp_info expected.info-np actual.info-np &&
+       test "$(sed -ne \"/^Path:/ s!/svnwc!!\" <expected.info-pwd)" = \
+            "$(sed -ne \"/^Path:/ s!/gitwc!!\" <actual.info-pwd)"
+       '
+
 test_expect_success 'info --url .' '
        test "$(cd gitwc; git svn info --url .)" = "$quoted_svnrepo"
        '