summaryrefslogtreecommitdiff
path: root/t/t9010-svn-fe.sh
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-11-19 18:53:34 -0600
committerJunio C Hamano <gitster@pobox.com>2010-11-24 14:52:51 -0800
commitc7dbf35e91cffbc326078d0c0470662f6422150d (patch)
treef1894b4a1b41af1730d3a3e018a6abfc9d501403 /t/t9010-svn-fe.sh
parent414e569e453a49171b1f3db613f88378324104e8 (diff)
downloadgit-c7dbf35e91cffbc326078d0c0470662f6422150d.tar.gz
vcs-svn: More dump format sanity checks
Node-action: change is not appropriate when switching between file and directory or adding a new file. Current svn-fe silently accepts such nodes and the resulting tree has missing files in the "changed when meant to add" case. Node-action: add requires some content (text or directory); there is no such thing as an "intent to add" node in svn dumps. Current svn-fe accepts such contentless adds but produces an invalid fast-import stream that refers to nonexistent mark :0 in response. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9010-svn-fe.sh')
-rwxr-xr-xt/t9010-svn-fe.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t9010-svn-fe.sh b/t/t9010-svn-fe.sh
index cb9a236245..f1e8799bbd 100755
--- a/t/t9010-svn-fe.sh
+++ b/t/t9010-svn-fe.sh
@@ -272,6 +272,27 @@ test_expect_success 'node without action' '
test_must_fail test-svn-fe inaction.dump
'
+test_expect_success 'action: add node without text' '
+ cat >textless.dump <<-\EOF &&
+ SVN-fs-dump-format-version: 3
+
+ Revision-number: 1
+ Prop-content-length: 10
+ Content-length: 10
+
+ PROPS-END
+
+ Node-path: textless
+ Node-kind: file
+ Node-action: add
+ Prop-content-length: 10
+ Content-length: 10
+
+ PROPS-END
+ EOF
+ test_must_fail test-svn-fe textless.dump
+'
+
test_expect_failure 'change file mode but keep old content' '
reinit_git &&
cat >expect <<-\EOF &&