X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=t%2Ft7400-submodule-basic.sh;h=9bda97058499ecab88dc6de7551d7909e1ad5a2e;hb=452c6d506b1a6dcf24d4ceaa592afc39c1c1a60e;hp=d9f27859932c33e126fa64c5c1fb80963dabb97a;hpb=8fbe9b32ce6f5e12ba3f8b9d4e3ccb0b8acf529f;p=git.git diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index d9f278599..9bda97058 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -86,25 +86,28 @@ test_expect_success 'submodule add' ' test_cmp empty untracked ' -test_expect_success 'submodule add to .gitignored path' ' - echo "refs/heads/master" >expect && - >empty && - +test_expect_success 'submodule add to .gitignored path fails' ' ( cd addtest-ignore && + cat <<-\EOF >expect && + The following path is ignored by one of your .gitignore files: + submod + Use -f if you really want to add it. + EOF # Does not use test_commit due to the ignore echo "*" > .gitignore && git add --force .gitignore && git commit -m"Ignore everything" && - git submodule add "$submodurl" submod && - git submodule init - ) && + ! git submodule add "$submodurl" submod >actual 2>&1 && + test_cmp expect actual + ) +' - rm -f heads head untracked && - inspect addtest/submod ../.. && - test_cmp expect heads && - test_cmp expect head && - test_cmp empty untracked +test_expect_success 'submodule add to .gitignored path with --force' ' + ( + cd addtest-ignore && + git submodule add --force "$submodurl" submod + ) ' test_expect_success 'submodule add --branch' '