summaryrefslogtreecommitdiff
path: root/t/t7400-submodule-basic.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t7400-submodule-basic.sh')
-rwxr-xr-xt/t7400-submodule-basic.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index a924fdb7a6..cb1b8e35db 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -51,7 +51,7 @@ test_expect_success 'submodule update aborts on missing gitmodules url' '
test_expect_success 'add aborts on repository with no commits' '
cat >expect <<-\EOF &&
- '"'repo-no-commits'"' does not have a commit checked out
+ fatal: '"'repo-no-commits'"' does not have a commit checked out
EOF
git init repo-no-commits &&
test_must_fail git submodule add ../a ./repo-no-commits 2>actual &&
@@ -196,6 +196,17 @@ test_expect_success 'submodule add to .gitignored path with --force' '
)
'
+test_expect_success 'submodule add to path with tracked content fails' '
+ (
+ cd addtest &&
+ echo "fatal: '\''dir-tracked'\'' already exists in the index" >expect &&
+ mkdir dir-tracked &&
+ test_commit foo dir-tracked/bar &&
+ test_must_fail git submodule add "$submodurl" dir-tracked >actual 2>&1 &&
+ test_cmp expect actual
+ )
+'
+
test_expect_success 'submodule add to reconfigure existing submodule with --force' '
(
cd addtest-ignore &&