2007-11-22 03:57:18 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2007 David D. Kilzer
|
|
|
|
|
2008-09-08 18:02:08 +08:00
|
|
|
test_description='git svn info'
|
2007-11-22 03:57:18 +08:00
|
|
|
|
|
|
|
. ./lib-git-svn.sh
|
2008-08-05 15:35:18 +08:00
|
|
|
|
|
|
|
# Tested with: svn, version 1.4.4 (r25188)
|
2010-03-04 04:34:32 +08:00
|
|
|
# Tested with: svn, version 1.6.[12345689]
|
2016-01-12 19:49:27 +08:00
|
|
|
v=$(svn_cmd --version | sed -n -e 's/^svn, version \(1\.[0-9]*\.[0-9]*\).*$/\1/p')
|
2008-08-05 15:35:18 +08:00
|
|
|
case $v in
|
2010-03-04 04:34:32 +08:00
|
|
|
1.[456].*)
|
2008-08-05 15:35:18 +08:00
|
|
|
;;
|
|
|
|
*)
|
2010-06-25 01:44:48 +08:00
|
|
|
skip_all="skipping svn-info test (SVN version: $v not supported)"
|
2008-08-05 15:35:18 +08:00
|
|
|
test_done
|
|
|
|
;;
|
|
|
|
esac
|
2007-11-22 03:57:18 +08:00
|
|
|
|
2010-12-07 08:00:02 +08:00
|
|
|
# On the "Text Last Updated" line, "git svn info" does not return the
|
|
|
|
# same value as "svn info" (i.e. the commit timestamp that touched the
|
|
|
|
# path most recently); do not expect that field to match.
|
|
|
|
test_cmp_info () {
|
2018-07-02 08:24:05 +08:00
|
|
|
sed -e '/^Text Last Updated:/d' "$1" >tmp.expect &&
|
|
|
|
sed -e '/^Text Last Updated:/d' "$2" >tmp.actual &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp tmp.expect tmp.actual &&
|
|
|
|
rm -f tmp.expect tmp.actual
|
2007-11-22 03:57:18 +08:00
|
|
|
}
|
|
|
|
|
2008-08-27 03:32:37 +08:00
|
|
|
quoted_svnrepo="$(echo $svnrepo | sed 's/ /%20/')"
|
|
|
|
|
2008-08-05 15:35:18 +08:00
|
|
|
test_expect_success 'setup repository and import' '
|
2007-11-22 03:57:18 +08:00
|
|
|
mkdir info &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd info &&
|
|
|
|
echo FIRST >A &&
|
|
|
|
echo one >file &&
|
2007-11-22 03:57:18 +08:00
|
|
|
ln -s file symlink-file &&
|
|
|
|
mkdir directory &&
|
|
|
|
touch directory/.placeholder &&
|
|
|
|
ln -s directory symlink-directory &&
|
2010-09-07 02:39:54 +08:00
|
|
|
svn_cmd import -m "initial" . "$svnrepo"
|
|
|
|
) &&
|
2009-05-08 16:06:16 +08:00
|
|
|
svn_cmd co "$svnrepo" svnwc &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd svnwc &&
|
|
|
|
echo foo >foo &&
|
2009-05-08 16:06:16 +08:00
|
|
|
svn_cmd add foo &&
|
|
|
|
svn_cmd commit -m "change outside directory" &&
|
2010-09-07 02:39:54 +08:00
|
|
|
svn_cmd update
|
|
|
|
) &&
|
2007-11-22 03:57:18 +08:00
|
|
|
mkdir gitwc &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd gitwc &&
|
2008-09-08 18:02:08 +08:00
|
|
|
git svn init "$svnrepo" &&
|
2010-09-07 02:39:54 +08:00
|
|
|
git svn fetch
|
2010-12-07 08:00:02 +08:00
|
|
|
)
|
2008-08-05 15:35:18 +08:00
|
|
|
'
|
2007-11-22 03:57:18 +08:00
|
|
|
|
|
|
|
test_expect_success 'info' "
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info) > expected.info &&
|
|
|
|
(cd gitwc && git svn info) > actual.info &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info actual.info
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url)" = "$quoted_svnrepo"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info .' "
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info .) > expected.info-dot &&
|
|
|
|
(cd gitwc && git svn info .) > actual.info-dot &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-dot actual.info-dot
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2014-08-03 09:44:08 +08:00
|
|
|
test_expect_success 'info $(pwd)' '
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info "$(pwd)") >expected.info-pwd &&
|
|
|
|
(cd gitwc && git svn info "$(pwd)") >actual.info-pwd &&
|
2014-08-03 09:44:08 +08:00
|
|
|
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' '
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info "$(pwd)/../svnwc") >expected.info-pwd &&
|
|
|
|
(cd gitwc && git svn info "$(pwd)/../gitwc") >actual.info-pwd &&
|
2014-08-03 09:44:08 +08:00
|
|
|
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' '
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info "$(pwd)/../svnwc//file") >expected.info-pwd &&
|
|
|
|
(cd gitwc && git svn info "$(pwd)/../gitwc//file") >actual.info-pwd &&
|
2014-08-03 09:44:08 +08:00
|
|
|
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)"
|
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url .' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url .)" = "$quoted_svnrepo"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info file' "
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info file) > expected.info-file &&
|
|
|
|
(cd gitwc && git svn info file) > actual.info-file &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-file actual.info-file
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url file' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url file)" = "$quoted_svnrepo/file"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info directory' "
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info directory) > expected.info-directory &&
|
|
|
|
(cd gitwc && git svn info directory) > actual.info-directory &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-directory actual.info-directory
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2008-08-27 03:32:36 +08:00
|
|
|
test_expect_success 'info inside directory' "
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc/directory && svn info) > expected.info-inside-directory &&
|
|
|
|
(cd gitwc/directory && git svn info) > actual.info-inside-directory &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-inside-directory actual.info-inside-directory
|
2008-08-27 03:32:36 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url directory' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url directory)" = "$quoted_svnrepo/directory"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info symlink-file' "
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info symlink-file) > expected.info-symlink-file &&
|
|
|
|
(cd gitwc && git svn info symlink-file) > actual.info-symlink-file &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-symlink-file actual.info-symlink-file
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url symlink-file' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url symlink-file)" \
|
2008-08-27 03:32:37 +08:00
|
|
|
= "$quoted_svnrepo/symlink-file"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info symlink-directory' "
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info symlink-directory) \
|
2007-11-22 03:57:18 +08:00
|
|
|
> expected.info-symlink-directory &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && git svn info symlink-directory) \
|
2007-11-22 03:57:18 +08:00
|
|
|
> actual.info-symlink-directory &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-symlink-directory actual.info-symlink-directory
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url symlink-directory' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url symlink-directory)" \
|
2008-08-27 03:32:37 +08:00
|
|
|
= "$quoted_svnrepo/symlink-directory"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info added-file' "
|
|
|
|
echo two > gitwc/added-file &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd gitwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
git add added-file
|
|
|
|
) &&
|
2007-11-22 03:57:18 +08:00
|
|
|
cp gitwc/added-file svnwc/added-file &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd svnwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
svn_cmd add added-file > /dev/null
|
|
|
|
) &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info added-file) > expected.info-added-file &&
|
|
|
|
(cd gitwc && git svn info added-file) > actual.info-added-file &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-added-file actual.info-added-file
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url added-file' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url added-file)" \
|
2008-08-27 03:32:37 +08:00
|
|
|
= "$quoted_svnrepo/added-file"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info added-directory' "
|
|
|
|
mkdir gitwc/added-directory svnwc/added-directory &&
|
|
|
|
touch gitwc/added-directory/.placeholder &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd svnwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
svn_cmd add added-directory > /dev/null
|
|
|
|
) &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd gitwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
git add added-directory
|
|
|
|
) &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info added-directory) \
|
2007-11-22 03:57:18 +08:00
|
|
|
> expected.info-added-directory &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && git svn info added-directory) \
|
2007-11-22 03:57:18 +08:00
|
|
|
> actual.info-added-directory &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-added-directory actual.info-added-directory
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url added-directory' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url added-directory)" \
|
2008-08-27 03:32:37 +08:00
|
|
|
= "$quoted_svnrepo/added-directory"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info added-symlink-file' "
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd gitwc &&
|
2007-11-22 03:57:18 +08:00
|
|
|
ln -s added-file added-symlink-file &&
|
2010-09-07 02:39:54 +08:00
|
|
|
git add added-symlink-file
|
|
|
|
) &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd svnwc &&
|
2007-11-22 03:57:18 +08:00
|
|
|
ln -s added-file added-symlink-file &&
|
2010-09-07 02:39:54 +08:00
|
|
|
svn_cmd add added-symlink-file > /dev/null
|
|
|
|
) &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info added-symlink-file) \
|
2007-11-22 03:57:18 +08:00
|
|
|
> expected.info-added-symlink-file &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && git svn info added-symlink-file) \
|
2007-11-22 03:57:18 +08:00
|
|
|
> actual.info-added-symlink-file &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-added-symlink-file \
|
|
|
|
actual.info-added-symlink-file
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url added-symlink-file' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url added-symlink-file)" \
|
2008-08-27 03:32:37 +08:00
|
|
|
= "$quoted_svnrepo/added-symlink-file"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info added-symlink-directory' "
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd gitwc &&
|
2007-11-22 03:57:18 +08:00
|
|
|
ln -s added-directory added-symlink-directory &&
|
2010-09-07 02:39:54 +08:00
|
|
|
git add added-symlink-directory
|
|
|
|
) &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd svnwc &&
|
2007-11-22 03:57:18 +08:00
|
|
|
ln -s added-directory added-symlink-directory &&
|
2010-09-07 02:39:54 +08:00
|
|
|
svn_cmd add added-symlink-directory > /dev/null
|
|
|
|
) &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info added-symlink-directory) \
|
2007-11-22 03:57:18 +08:00
|
|
|
> expected.info-added-symlink-directory &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && git svn info added-symlink-directory) \
|
2007-11-22 03:57:18 +08:00
|
|
|
> actual.info-added-symlink-directory &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-added-symlink-directory \
|
|
|
|
actual.info-added-symlink-directory
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url added-symlink-directory' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url added-symlink-directory)" \
|
2008-08-27 03:32:37 +08:00
|
|
|
= "$quoted_svnrepo/added-symlink-directory"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info deleted-file' "
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd gitwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
git rm -f file > /dev/null
|
|
|
|
) &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd svnwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
svn_cmd rm --force file > /dev/null
|
|
|
|
) &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info file) >expected.info-deleted-file &&
|
|
|
|
(cd gitwc && git svn info file) >actual.info-deleted-file &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-deleted-file actual.info-deleted-file
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url file (deleted)' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url file)" \
|
2008-08-27 03:32:37 +08:00
|
|
|
= "$quoted_svnrepo/file"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info deleted-directory' "
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd gitwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
git rm -r -f directory > /dev/null
|
|
|
|
) &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd svnwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
svn_cmd rm --force directory > /dev/null
|
|
|
|
) &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info directory) >expected.info-deleted-directory &&
|
|
|
|
(cd gitwc && git svn info directory) >actual.info-deleted-directory &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-deleted-directory actual.info-deleted-directory
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url directory (deleted)' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url directory)" \
|
2008-08-27 03:32:37 +08:00
|
|
|
= "$quoted_svnrepo/directory"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info deleted-symlink-file' "
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd gitwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
git rm -f symlink-file > /dev/null
|
|
|
|
) &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd svnwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
svn_cmd rm --force symlink-file > /dev/null
|
|
|
|
) &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info symlink-file) >expected.info-deleted-symlink-file &&
|
|
|
|
(cd gitwc && git svn info symlink-file) >actual.info-deleted-symlink-file &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-deleted-symlink-file actual.info-deleted-symlink-file
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url symlink-file (deleted)' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url symlink-file)" \
|
2008-08-27 03:32:37 +08:00
|
|
|
= "$quoted_svnrepo/symlink-file"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info deleted-symlink-directory' "
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd gitwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
git rm -f symlink-directory > /dev/null
|
|
|
|
) &&
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd svnwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
svn_cmd rm --force symlink-directory > /dev/null
|
|
|
|
) &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd svnwc && svn info symlink-directory) >expected.info-deleted-symlink-directory &&
|
|
|
|
(cd gitwc && git svn info symlink-directory) >actual.info-deleted-symlink-directory &&
|
2010-12-07 08:00:02 +08:00
|
|
|
test_cmp_info expected.info-deleted-symlink-directory actual.info-deleted-symlink-directory
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url symlink-directory (deleted)' '
|
2018-07-02 08:24:05 +08:00
|
|
|
test "$(cd gitwc && git svn info --url symlink-directory)" \
|
2008-08-27 03:32:37 +08:00
|
|
|
= "$quoted_svnrepo/symlink-directory"
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
# NOTE: git does not have the concept of replaced objects,
|
|
|
|
# so we can't test for files in that state.
|
|
|
|
|
|
|
|
test_expect_success 'info unknown-file' "
|
|
|
|
echo two > gitwc/unknown-file &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && test_must_fail git svn info unknown-file) \
|
2008-08-29 21:42:49 +08:00
|
|
|
2> actual.info-unknown-file &&
|
|
|
|
grep unknown-file actual.info-unknown-file
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url unknown-file' '
|
2008-08-29 21:42:49 +08:00
|
|
|
echo two > gitwc/unknown-file &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && test_must_fail git svn info --url unknown-file) \
|
2008-08-29 21:42:49 +08:00
|
|
|
2> actual.info-url-unknown-file &&
|
|
|
|
grep unknown-file actual.info-url-unknown-file
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info unknown-directory' "
|
|
|
|
mkdir gitwc/unknown-directory svnwc/unknown-directory &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && test_must_fail git svn info unknown-directory) \
|
2008-08-29 21:42:49 +08:00
|
|
|
2> actual.info-unknown-directory &&
|
|
|
|
grep unknown-directory actual.info-unknown-directory
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url unknown-directory' '
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && test_must_fail git svn info --url unknown-directory) \
|
2008-08-29 21:42:49 +08:00
|
|
|
2> actual.info-url-unknown-directory &&
|
|
|
|
grep unknown-directory actual.info-url-unknown-directory
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info unknown-symlink-file' "
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd gitwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
ln -s unknown-file unknown-symlink-file
|
|
|
|
) &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && test_must_fail git svn info unknown-symlink-file) \
|
2008-08-29 21:42:49 +08:00
|
|
|
2> actual.info-unknown-symlink-file &&
|
|
|
|
grep unknown-symlink-file actual.info-unknown-symlink-file
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url unknown-symlink-file' '
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && test_must_fail git svn info --url unknown-symlink-file) \
|
2008-08-29 21:42:49 +08:00
|
|
|
2> actual.info-url-unknown-symlink-file &&
|
|
|
|
grep unknown-symlink-file actual.info-url-unknown-symlink-file
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_expect_success 'info unknown-symlink-directory' "
|
2010-09-07 09:42:54 +08:00
|
|
|
(
|
|
|
|
cd gitwc &&
|
2010-09-07 02:39:54 +08:00
|
|
|
ln -s unknown-directory unknown-symlink-directory
|
|
|
|
) &&
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && test_must_fail git svn info unknown-symlink-directory) \
|
2008-08-29 21:42:49 +08:00
|
|
|
2> actual.info-unknown-symlink-directory &&
|
|
|
|
grep unknown-symlink-directory actual.info-unknown-symlink-directory
|
2007-11-22 03:57:18 +08:00
|
|
|
"
|
|
|
|
|
2007-11-22 03:57:19 +08:00
|
|
|
test_expect_success 'info --url unknown-symlink-directory' '
|
2018-07-02 08:24:05 +08:00
|
|
|
(cd gitwc && test_must_fail git svn info --url unknown-symlink-directory) \
|
2008-08-29 21:42:49 +08:00
|
|
|
2> actual.info-url-unknown-symlink-directory &&
|
|
|
|
grep unknown-symlink-directory actual.info-url-unknown-symlink-directory
|
2007-11-22 03:57:19 +08:00
|
|
|
'
|
|
|
|
|
2007-11-22 03:57:18 +08:00
|
|
|
test_done
|