summaryrefslogtreecommitdiff
path: root/t/t7406-submodule-update.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t7406-submodule-update.sh')
-rwxr-xr-xt/t7406-submodule-update.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index fa9d23aa31..5d24d9ff74 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -74,6 +74,29 @@ test_expect_success 'submodule update detaching the HEAD ' '
)
'
+test_expect_success 'submodule update should fail due to local changes' '
+ (cd super/submodule &&
+ git reset --hard HEAD~1 &&
+ echo "local change" > file
+ ) &&
+ (cd super &&
+ (cd submodule &&
+ compare_head
+ ) &&
+ test_must_fail git submodule update submodule
+ )
+'
+test_expect_success 'submodule update should throw away changes with --force ' '
+ (cd super &&
+ (cd submodule &&
+ compare_head
+ ) &&
+ git submodule update --force submodule &&
+ cd submodule &&
+ ! compare_head
+ )
+'
+
test_expect_success 'submodule update --rebase staying on master' '
(cd super/submodule &&
git checkout master