unpack-trees.c: assume submodules are clean during check-out
In particular, when moving back to a commit without a given submodule and then moving back forward to a commit with the given submodule, we shouldn't complain that updating would lose untracked file in the submodule, because git currently does not checkout subprojects during superproject check-out. Signed-off-by: Sven Verdoolaege <skimo@kotnet.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
c1c10a3f27
commit
0cf7375542
@ -21,6 +21,10 @@ subcommands of git-submodule.
|
||||
# -add an entry to .gitmodules for submodule 'example'
|
||||
#
|
||||
test_expect_success 'Prepare submodule testing' '
|
||||
: > t &&
|
||||
git-add t &&
|
||||
git-commit -m "initial commit" &&
|
||||
git branch initial HEAD &&
|
||||
mkdir lib &&
|
||||
cd lib &&
|
||||
git init &&
|
||||
@ -166,4 +170,9 @@ test_expect_success 'status should be "up-to-date" after update' '
|
||||
git-submodule status | grep "^ $rev1"
|
||||
'
|
||||
|
||||
test_expect_success 'checkout superproject with subproject already present' '
|
||||
git-checkout initial &&
|
||||
git-checkout master
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user