2005-06-07 22:36:30 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2005 Junio C Hamano
|
|
|
|
#
|
|
|
|
|
|
|
|
test_description='Two way merge with read-tree -m -u $H $M
|
|
|
|
|
|
|
|
This is identical to t1001, but uses -u to update the work tree as well.
|
|
|
|
|
|
|
|
'
|
|
|
|
. ./test-lib.sh
|
2011-05-26 00:10:41 +04:00
|
|
|
. "$TEST_DIRECTORY"/lib-read-tree.sh
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
compare_change () {
|
|
|
|
sed >current \
|
2008-08-19 03:17:53 +04:00
|
|
|
-e '1{/^diff --git /d;}' \
|
|
|
|
-e '2{/^index /d;}' \
|
2005-06-07 22:36:30 +04:00
|
|
|
-e '/^--- /d; /^+++ /d; /^@@ /d;' \
|
|
|
|
-e 's/^\(.[0-7][0-7][0-7][0-7][0-7][0-7]\) '"$_x40"' /\1 X /' "$1"
|
2008-05-24 09:28:56 +04:00
|
|
|
test_cmp expected current
|
2005-06-07 22:36:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
check_cache_at () {
|
2007-07-03 09:52:14 +04:00
|
|
|
clean_if_empty=`git diff-files -- "$1"`
|
2005-06-07 22:36:30 +04:00
|
|
|
case "$clean_if_empty" in
|
|
|
|
'') echo "$1: clean" ;;
|
|
|
|
?*) echo "$1: dirty" ;;
|
|
|
|
esac
|
|
|
|
case "$2,$clean_if_empty" in
|
|
|
|
clean,) : ;;
|
|
|
|
clean,?*) false ;;
|
|
|
|
dirty,) false ;;
|
|
|
|
dirty,?*) : ;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
setup \
|
|
|
|
'echo frotz >frotz &&
|
|
|
|
echo nitfol >nitfol &&
|
|
|
|
echo bozbar >bozbar &&
|
|
|
|
echo rezrov >rezrov &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add nitfol bozbar rezrov &&
|
|
|
|
treeH=`git write-tree` &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo treeH $treeH &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-tree $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
echo gnusto >bozbar &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add frotz bozbar --force-remove rezrov &&
|
|
|
|
git ls-files --stage >M.out &&
|
|
|
|
treeM=`git write-tree` &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo treeM $treeM &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-tree $treeM &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum bozbar frotz nitfol >M.sum &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git diff-tree $treeH $treeM'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'1, 2, 3 - no carry forward' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
|
|
|
read_tree_u_must_succeed -m -u $treeH $treeM &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-files --stage >1-3.out &&
|
2005-06-07 22:36:30 +04:00
|
|
|
cmp M.out 1-3.out &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum bozbar frotz nitfol >actual3.sum &&
|
|
|
|
cmp M.sum actual3.sum &&
|
2005-06-07 22:36:30 +04:00
|
|
|
check_cache_at bozbar clean &&
|
|
|
|
check_cache_at frotz clean &&
|
|
|
|
check_cache_at nitfol clean'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'4 - carry forward local addition.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2006-05-17 12:17:46 +04:00
|
|
|
echo "+100644 X 0 yomin" >expected &&
|
|
|
|
echo yomin >yomin &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add yomin &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u $treeH $treeM &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-files --stage >4.out || return 1
|
2008-08-19 03:17:53 +04:00
|
|
|
git diff -U0 --no-index M.out 4.out >4diff.out
|
2005-06-07 22:36:30 +04:00
|
|
|
compare_change 4diff.out expected &&
|
|
|
|
check_cache_at yomin clean &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum bozbar frotz nitfol >actual4.sum &&
|
|
|
|
cmp M.sum actual4.sum &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo yomin >yomin1 &&
|
|
|
|
diff yomin yomin1 &&
|
|
|
|
rm -f yomin1'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'5 - carry forward local addition.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
|
|
|
read_tree_u_must_succeed -m -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo yomin >yomin &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add yomin &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo yomin yomin >yomin &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u $treeH $treeM &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-files --stage >5.out || return 1
|
2008-08-19 03:17:53 +04:00
|
|
|
git diff -U0 --no-index M.out 5.out >5diff.out
|
2005-06-07 22:36:30 +04:00
|
|
|
compare_change 5diff.out expected &&
|
|
|
|
check_cache_at yomin dirty &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum bozbar frotz nitfol >actual5.sum &&
|
|
|
|
cmp M.sum actual5.sum &&
|
2005-06-08 13:08:54 +04:00
|
|
|
: dirty index should have prevented -u from checking it out. &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo yomin yomin >yomin1 &&
|
|
|
|
diff yomin yomin1 &&
|
|
|
|
rm -f yomin1'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'6 - local addition already has the same.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2006-05-17 12:17:46 +04:00
|
|
|
echo frotz >frotz &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u $treeH $treeM &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-files --stage >6.out &&
|
2008-07-23 01:17:43 +04:00
|
|
|
test_cmp M.out 6.out &&
|
2005-06-07 22:36:30 +04:00
|
|
|
check_cache_at frotz clean &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum bozbar frotz nitfol >actual3.sum &&
|
|
|
|
cmp M.sum actual3.sum &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo frotz >frotz1 &&
|
|
|
|
diff frotz frotz1 &&
|
|
|
|
rm -f frotz1'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'7 - local addition already has the same.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo frotz >frotz &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add frotz &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo frotz frotz >frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u $treeH $treeM &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-files --stage >7.out &&
|
2008-07-23 01:17:43 +04:00
|
|
|
test_cmp M.out 7.out &&
|
2005-06-07 22:36:30 +04:00
|
|
|
check_cache_at frotz dirty &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum bozbar frotz nitfol >actual7.sum &&
|
|
|
|
if cmp M.sum actual7.sum; then false; else :; fi &&
|
2005-06-08 13:08:54 +04:00
|
|
|
: dirty index should have prevented -u from checking it out. &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo frotz frotz >frotz1 &&
|
|
|
|
diff frotz frotz1 &&
|
|
|
|
rm -f frotz1'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'8 - conflicting addition.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo frotz frotz >frotz &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'9 - conflicting addition.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo frotz frotz >frotz &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add frotz &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo frotz >frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'10 - path removed.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo rezrov >rezrov &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add rezrov &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u $treeH $treeM &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-files --stage >10.out &&
|
2005-06-07 22:36:30 +04:00
|
|
|
cmp M.out 10.out &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum bozbar frotz nitfol >actual10.sum &&
|
|
|
|
cmp M.sum actual10.sum'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'11 - dirty path removed.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo rezrov >rezrov &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add rezrov &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo rezrov rezrov >rezrov &&
|
2011-05-26 00:10:41 +04:00
|
|
|
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'12 - unmatching local changes being removed.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo rezrov rezrov >rezrov &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add rezrov &&
|
2011-05-26 00:10:41 +04:00
|
|
|
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'13 - unmatching local changes being removed.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo rezrov rezrov >rezrov &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add rezrov &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo rezrov >rezrov &&
|
2011-05-26 00:10:41 +04:00
|
|
|
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
cat >expected <<EOF
|
|
|
|
-100644 X 0 nitfol
|
|
|
|
+100644 X 0 nitfol
|
|
|
|
EOF
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'14 - unchanged in two heads.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo nitfol nitfol >nitfol &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add nitfol &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u $treeH $treeM &&
|
2010-10-04 00:00:02 +04:00
|
|
|
git ls-files --stage >14.out &&
|
|
|
|
test_must_fail git diff -U0 --no-index M.out 14.out >14diff.out &&
|
2005-06-07 22:36:30 +04:00
|
|
|
compare_change 14diff.out expected &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum bozbar frotz >actual14.sum &&
|
|
|
|
grep -v nitfol M.sum > expected14.sum &&
|
|
|
|
cmp expected14.sum actual14.sum &&
|
|
|
|
sum bozbar frotz nitfol >actual14a.sum &&
|
|
|
|
if cmp M.sum actual14a.sum; then false; else :; fi &&
|
2005-06-07 22:36:30 +04:00
|
|
|
check_cache_at nitfol clean &&
|
|
|
|
echo nitfol nitfol >nitfol1 &&
|
|
|
|
diff nitfol nitfol1 &&
|
|
|
|
rm -f nitfol1'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'15 - unchanged in two heads.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo nitfol nitfol >nitfol &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add nitfol &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo nitfol nitfol nitfol >nitfol &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u $treeH $treeM &&
|
2010-10-04 00:00:02 +04:00
|
|
|
git ls-files --stage >15.out &&
|
|
|
|
test_must_fail git diff -U0 --no-index M.out 15.out >15diff.out &&
|
2005-06-07 22:36:30 +04:00
|
|
|
compare_change 15diff.out expected &&
|
|
|
|
check_cache_at nitfol dirty &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum bozbar frotz >actual15.sum &&
|
|
|
|
grep -v nitfol M.sum > expected15.sum &&
|
|
|
|
cmp expected15.sum actual15.sum &&
|
|
|
|
sum bozbar frotz nitfol >actual15a.sum &&
|
|
|
|
if cmp M.sum actual15a.sum; then false; else :; fi &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo nitfol nitfol nitfol >nitfol1 &&
|
|
|
|
diff nitfol nitfol1 &&
|
|
|
|
rm -f nitfol1'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'16 - conflicting local change.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo bozbar bozbar >bozbar &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add bozbar &&
|
2011-05-26 00:10:41 +04:00
|
|
|
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'17 - conflicting local change.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo bozbar bozbar >bozbar &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add bozbar &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo bozbar bozbar bozbar >bozbar &&
|
2011-05-26 00:10:41 +04:00
|
|
|
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'18 - local change already having a good result.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo gnusto >bozbar &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add bozbar &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u $treeH $treeM &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-files --stage >18.out &&
|
2008-07-23 01:17:43 +04:00
|
|
|
test_cmp M.out 18.out &&
|
2005-06-07 22:36:30 +04:00
|
|
|
check_cache_at bozbar clean &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum bozbar frotz nitfol >actual18.sum &&
|
|
|
|
cmp M.sum actual18.sum'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'19 - local change already having a good result, further modified.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo gnusto >bozbar &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add bozbar &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo gnusto gnusto >bozbar &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u $treeH $treeM &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-files --stage >19.out &&
|
2008-07-23 01:17:43 +04:00
|
|
|
test_cmp M.out 19.out &&
|
2005-06-07 22:36:30 +04:00
|
|
|
check_cache_at bozbar dirty &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum frotz nitfol >actual19.sum &&
|
|
|
|
grep -v bozbar M.sum > expected19.sum &&
|
|
|
|
cmp expected19.sum actual19.sum &&
|
|
|
|
sum bozbar frotz nitfol >actual19a.sum &&
|
|
|
|
if cmp M.sum actual19a.sum; then false; else :; fi &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo gnusto gnusto >bozbar1 &&
|
|
|
|
diff bozbar bozbar1 &&
|
|
|
|
rm -f bozbar1'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'20 - no local change, use new tree.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo bozbar >bozbar &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add bozbar &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u $treeH $treeM &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-files --stage >20.out &&
|
2008-07-23 01:17:43 +04:00
|
|
|
test_cmp M.out 20.out &&
|
2005-06-07 22:36:30 +04:00
|
|
|
check_cache_at bozbar clean &&
|
2005-06-28 05:40:31 +04:00
|
|
|
sum bozbar frotz nitfol >actual20.sum &&
|
|
|
|
cmp M.sum actual20.sum'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'21 - no local change, dirty cache.' \
|
2006-05-17 12:17:46 +04:00
|
|
|
'rm -f .git/index nitfol bozbar rezrov frotz &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed --reset -u $treeH &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo bozbar >bozbar &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add bozbar &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo gnusto gnusto >bozbar &&
|
2011-05-26 00:10:41 +04:00
|
|
|
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
# Also make sure we did not break DF vs DF/DF case.
|
|
|
|
test_expect_success \
|
|
|
|
'DF vs DF/DF case setup.' \
|
2010-10-04 00:00:02 +04:00
|
|
|
'rm -f .git/index &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo DF >DF &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add DF &&
|
|
|
|
treeDF=`git write-tree` &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo treeDF $treeDF &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-tree $treeDF &&
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
rm -f DF &&
|
|
|
|
mkdir DF &&
|
|
|
|
echo DF/DF >DF/DF &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add --remove DF DF/DF &&
|
|
|
|
treeDFDF=`git write-tree` &&
|
2005-06-07 22:36:30 +04:00
|
|
|
echo treeDFDF $treeDFDF &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-tree $treeDFDF &&
|
|
|
|
git ls-files --stage >DFDF.out'
|
2005-06-07 22:36:30 +04:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'DF vs DF/DF case test.' \
|
|
|
|
'rm -f .git/index &&
|
|
|
|
rm -fr DF &&
|
|
|
|
echo DF >DF &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git update-index --add DF &&
|
2011-05-26 00:10:41 +04:00
|
|
|
read_tree_u_must_succeed -m -u $treeDF $treeDFDF &&
|
2007-07-03 09:52:14 +04:00
|
|
|
git ls-files --stage >DFDFcheck.out &&
|
2008-07-23 01:17:43 +04:00
|
|
|
test_cmp DFDF.out DFDFcheck.out &&
|
2005-06-07 22:36:30 +04:00
|
|
|
check_cache_at DF/DF clean'
|
|
|
|
|
|
|
|
test_done
|