Merge branch 'dw/signoff-doc' into maint
[gitweb.git] / contrib / subtree / t / t7900-subtree.sh
index 2683d7d479083994eb5032b391b203b3598fc2d0..751aee3a0cd782c9eb1f98cb78f582011fb0b181 100755 (executable)
@@ -257,6 +257,26 @@ test_expect_success 'merge the added subproj again, should do nothing' '
        )
 '
 
+next_test
+test_expect_success 'merge new subproj history into subdir/ with a slash appended to the argument of --prefix' '
+       test_create_repo "$test_count" &&
+       test_create_repo "$test_count/subproj" &&
+       test_create_commit "$test_count" main1 &&
+       test_create_commit "$test_count/subproj" sub1 &&
+       (
+               cd "$test_count" &&
+               git fetch ./subproj master &&
+               git subtree add --prefix=subdir/ FETCH_HEAD
+       ) &&
+       test_create_commit "$test_count/subproj" sub2 &&
+       (
+               cd "$test_count" &&
+               git fetch ./subproj master &&
+               git subtree merge --prefix=subdir/ FETCH_HEAD &&
+               check_equal "$(last_commit_message)" "Merge commit '\''$(git rev-parse FETCH_HEAD)'\''"
+       )
+'
+
 #
 # Tests for 'git subtree split'
 #