Merge branch 'sb/submodule-update-reset-fix' into maint
[gitweb.git] / t / lib-submodule-update.sh
index fb0173ea87326a5e67b90e2dcf3117528ca38f17..1f38a85371ab49790d14d3d4b82a0ee6e52789dd 100755 (executable)
@@ -1015,4 +1015,18 @@ test_submodule_forced_switch_recursing_with_args () {
                        test_submodule_content sub1 origin/modify_sub1
                )
        '
+
+       test_expect_success "$command: changed submodule worktree is reset" '
+               prolog &&
+               reset_work_tree_to_interested add_sub1 &&
+               (
+                       cd submodule_update &&
+                       rm sub1/file1 &&
+                       : >sub1/new_file &&
+                       git -C sub1 add new_file &&
+                       $command HEAD &&
+                       test_path_is_file sub1/file1 &&
+                       test_path_is_missing sub1/new_file
+               )
+       '
 }