[PATCH] Add a new test to ensure merging a submodule is handled properly.
- From
Miklos Vajna <vmiklos@frugalware.org>
- Date
- Aug 11, 2008, 20:48 UTC
- Message-ID
- <1218487680-7933-1-git-send-email-vmiklos@frugalware.org>
- In-Reply-To
- <20080811204511.GV18960@genesis.frugalware.org>
In this test we cause a directory / submodule conflict then we check if the index is unlocked properly.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> ---
I'm no exactly sure if this should be included or not, I just wrote it to make sure that a die() insure merge-recursive will not cause an unlocked index at the end.
t/t7607-merge-submodule.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) create mode 100755 t/t7607-merge-submodule.sh
diff --git a/t/t7607-merge-submodule.sh b/t/t7607-merge-submodule.sh new file mode 100755 index 0000000..552930a --- /dev/null +++ b/t/t7607-merge-submodule.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +test_description='git-merge + +Testing if a directory / submodule conflict is handled properly.' + +. ./test-lib.sh + +test_expect_success 'setup' ' + mkdir lib && + cd lib && + git init && + echo c1 >c1.c && + git add c1.c && + git commit -m "submodule init" && + mkdir ../main && + cd ../main && + git init && + echo main >main.c && + git add main.c && + git commit -m "c0: main init" && + git tag c0 && + mkdir lib && + echo lib >lib/c1.c && + git add lib/c1.c && + git commit -m "c1: lib init" && + git tag c1 && + git reset --hard c0 && + git submodule add "`pwd`/../lib" lib && + git commit -m "c2: add submodule" && + git tag c2 +' + +test_expect_success 'dir/submodule conflict' ' + git reset --hard c1 && + test_must_fail git merge c2 && + test ! -f .git/index.lock +' + +test_done
-- 1.6.0.rc0.14.g95f8.dirty