Merge branch 'jc/maint-checkout-fix'
* jc/maint-checkout-fix: checkout: do not check out unmerged higher stages randomly Conflicts: t/t7201-co.sh
This commit is contained in:
@ -369,4 +369,26 @@ test_expect_success \
|
||||
'checkout with --track, but without -b, fails with too short tracked name' '
|
||||
test_must_fail git checkout --track renamer'
|
||||
|
||||
test_expect_success 'checkout an unmerged path should fail' '
|
||||
rm -f .git/index &&
|
||||
O=$(echo original | git hash-object -w --stdin) &&
|
||||
A=$(echo ourside | git hash-object -w --stdin) &&
|
||||
B=$(echo theirside | git hash-object -w --stdin) &&
|
||||
(
|
||||
echo "100644 $A 0 fild" &&
|
||||
echo "100644 $O 1 file" &&
|
||||
echo "100644 $A 2 file" &&
|
||||
echo "100644 $B 3 file" &&
|
||||
echo "100644 $A 0 filf"
|
||||
) | git update-index --index-info &&
|
||||
echo "none of the above" >sample &&
|
||||
cat sample >fild &&
|
||||
cat sample >file &&
|
||||
cat sample >filf &&
|
||||
test_must_fail git checkout fild file filf &&
|
||||
test_cmp sample fild &&
|
||||
test_cmp sample filf &&
|
||||
test_cmp sample file
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user