diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-01-19 08:25:41 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-01-19 08:25:41 -0800 |
commit | f326a06497c6609b109c35bab6d8187b02dad81f (patch) | |
tree | 05a09b6a6871ad436e4a5ab05a4d6b19565ddac1 /t | |
parent | d84f28093719ce499e701f646f20ee62755147ad (diff) | |
parent | 69e7236c6df44bfcde8913972b75a6ccb360d58f (diff) | |
download | git-f326a06497c6609b109c35bab6d8187b02dad81f.tar.gz git-f326a06497c6609b109c35bab6d8187b02dad81f.tar.xz |
Merge branch 'jn/submodule-b-current' into maint
* jn/submodule-b-current:
git submodule: Remove now obsolete tests before cloning a repo
git submodule -b ... of current HEAD fails
Diffstat (limited to 't')
-rwxr-xr-x | t/t7400-submodule-basic.sh | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index 782b0a3ec..2c49db9f6 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -421,11 +421,29 @@ test_expect_success 'add submodules without specifying an explicit path' ' git commit -m "repo commit 1" ) && git clone --bare repo/ bare.git && - cd addtest && - git submodule add "$submodurl/repo" && - git config -f .gitmodules submodule.repo.path repo && - git submodule add "$submodurl/bare.git" && - git config -f .gitmodules submodule.bare.path bare + ( + cd addtest && + git submodule add "$submodurl/repo" && + git config -f .gitmodules submodule.repo.path repo && + git submodule add "$submodurl/bare.git" && + git config -f .gitmodules submodule.bare.path bare + ) +' + +test_expect_success 'add should fail when path is used by a file' ' + ( + cd addtest && + touch file && + test_must_fail git submodule add "$submodurl/repo" file + ) +' + +test_expect_success 'add should fail when path is used by an existing directory' ' + ( + cd addtest && + mkdir empty-dir && + test_must_fail git submodule add "$submodurl/repo" empty-dir + ) ' test_done |