t9300 (fast-import): another test for the "replace root" feature
Another test for the replace root feature. One can imagine an implementation for which R "some/subdir" "" would free some state associated to the subdir and leave fast-import confused. Luckily, git's is not such an implementation. While at it, change the previous test to use C "some/subdir" "" instead of R (i.e., test both syntaxes). Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Oct 17, 2010 at 20:44 UTC
971728c853f8fcdfcecd768c74010965c383c431
1 file changed
+42
-1
t/t9300-fast-import.sh
+42
-1
@@ -990,11 +990,52 @@ test_expect_success \
990
COMMIT
991
992
M 040000 $branch ""
993
- R "newdir" ""
993
+ C "newdir" ""
994
INPUT_END
995
git fast-import <input &&
996
git diff --exit-code branch:newdir N9'
997
998
+test_expect_success \
999
+ 'N: modify subtree, extract it, and modify again' \
1000
+ 'echo hello >expect.baz &&
1001
+ echo hello, world >expect.qux &&
1002
+ git fast-import <<-SETUP_END &&
1003
+ commit refs/heads/N10
1004
+ committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1005
+ data <<COMMIT
1006
+ hello, tree
1007
+ COMMIT
1008
+
1009
+ deleteall
1010
+ M 644 inline foo/bar/baz
1011
+ data <<EOF
1012
+ hello
1013
+ EOF
1014
+ SETUP_END
1015
+
1016
+ tree=$(git rev-parse --verify N10:) &&
1017
+ git fast-import <<-INPUT_END &&
1018
+ commit refs/heads/N11
1019
+ committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1020
+ data <<COMMIT
1021
+ copy to root by id and modify
1022
+ COMMIT
1023
+
1024
+ M 040000 $tree ""
1025
+ M 100644 inline foo/bar/qux
1026
+ data <<EOF
1027
+ hello, world
1028
+ EOF
1029
+ R "foo" ""
1030
+ C "bar/qux" "bar/quux"
1031
+ INPUT_END
1032
+ git show N11:bar/baz >actual.baz &&
1033
+ git show N11:bar/qux >actual.qux &&
1034
+ git show N11:bar/quux >actual.quux &&
1035
+ test_cmp expect.baz actual.baz &&
1036
+ test_cmp expect.qux actual.qux &&
1037
+ test_cmp expect.qux actual.quux'
1038
+
1039
###
1040
### series O
1041
###