Merge branch 'da/difftool-dir-diff-fix' into da/t7800-cleanup
[gitweb.git] / contrib / subtree / t / t7900-subtree.sh
index 7e8be5adff4d085b31fc255687d26bc8519b78a9..3c87ebaf57baede9810c3b9b489eed9751189706 100755 (executable)
@@ -346,6 +346,22 @@ test_expect_success 'split sub dir/ with --rejoin' '
        )
  '
 
+next_test
+test_expect_success 'split sub dir/ with --rejoin from scratch' '
+       subtree_test_create_repo "$subtree_test_count" &&
+       test_create_commit "$subtree_test_count" main1 &&
+       (
+               cd "$subtree_test_count" &&
+               mkdir "sub dir" &&
+               echo file >"sub dir"/file &&
+               git add "sub dir/file" &&
+               git commit -m"sub dir file" &&
+               split_hash=$(git subtree split --prefix="sub dir" --rejoin) &&
+               git subtree split --prefix="sub dir" --rejoin &&
+               check_equal "$(last_commit_message)" "Split '\''sub dir/'\'' into commit '\''$split_hash'\''"
+       )
+ '
+
 next_test
 test_expect_success 'split sub dir/ with --rejoin and --message' '
        subtree_test_create_repo "$subtree_test_count" &&
@@ -932,7 +948,7 @@ test_expect_success 'split a new subtree without --onto option' '
 
                # also test that we still can split out an entirely new subtree
                # if the parent of the first commit in the tree is not empty,
-               # then the new subtree has accidently been attached to something
+               # then the new subtree has accidentally been attached to something
                git subtree split --prefix="sub dir2" --branch subproj2-br &&
                check_equal "$(git log --pretty=format:%P -1 subproj2-br)" ""
        )