summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1c7bb31)
raw | patch | inline | side by side (parent: 1c7bb31)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Sat, 20 Nov 2010 00:52:59 +0000 (18:52 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 24 Nov 2010 22:52:47 +0000 (14:52 -0800) |
It would be better to flag such errors and let the import proceed
anyway, but for now it is simpler not to worry about recovery
from such weird cases.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
anyway, but for now it is simpler not to worry about recovery
from such weird cases.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9010-svn-fe.sh | patch | blob | history | |
vcs-svn/svndump.c | patch | blob | history |
diff --git a/t/t9010-svn-fe.sh b/t/t9010-svn-fe.sh
index 729e73dddfecffb712d4ea3a8103a27c36847f46..cb9a236245695fb723f9466e9c0d5d98709d7027 100755 (executable)
--- a/t/t9010-svn-fe.sh
+++ b/t/t9010-svn-fe.sh
test_cmp hi directory/file2
'
+test_expect_success 'node without action' '
+ cat >inaction.dump <<-\EOF &&
+ SVN-fs-dump-format-version: 3
+
+ Revision-number: 1
+ Prop-content-length: 10
+ Content-length: 10
+
+ PROPS-END
+
+ Node-path: directory
+ Node-kind: dir
+ Prop-content-length: 10
+ Content-length: 10
+
+ PROPS-END
+ EOF
+ test_must_fail test-svn-fe inaction.dump
+'
+
test_expect_failure 'change file mode but keep old content' '
reinit_git &&
cat >expect <<-\EOF &&
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c
index 4fdfcbbc0d6ac01987229c99907367fa5bf38483..0af8ac6807c289599237ccc73a0eeed9fad5277a 100644 (file)
--- a/vcs-svn/svndump.c
+++ b/vcs-svn/svndump.c
if (node_ctx.srcRev) {
repo_copy(node_ctx.srcRev, node_ctx.src, node_ctx.dst);
- node_ctx.action = NODEACT_CHANGE;
+ if (node_ctx.action == NODEACT_ADD)
+ node_ctx.action = NODEACT_CHANGE;
}
if (mark && type == REPO_MODE_DIR)
if (node_ctx.action == NODEACT_CHANGE)
node_ctx.type = repo_modify_path(node_ctx.dst, 0, mark);
- else /* Node-action: add */
+ else if (node_ctx.action == NODEACT_ADD)
repo_add(node_ctx.dst, type, mark);
+ else
+ die("invalid dump: Node-path block lacks Node-action");
if (have_props) {
const uint32_t old_mode = node_ctx.type;