2010-05-01 11:25:12 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test_description='git update-index --assume-unchanged test.
|
|
|
|
'
|
|
|
|
|
2021-11-16 19:27:38 +01:00
|
|
|
TEST_PASSES_SANITIZE_LEAK=true
|
2010-05-01 11:25:12 +02:00
|
|
|
. ./test-lib.sh
|
|
|
|
|
2020-11-18 15:49:05 +01:00
|
|
|
test_expect_success 'setup' '
|
|
|
|
: >file &&
|
|
|
|
git add file &&
|
|
|
|
git commit -m initial &&
|
|
|
|
git branch other &&
|
|
|
|
echo upstream >file &&
|
|
|
|
git add file &&
|
|
|
|
git commit -m upstream
|
|
|
|
'
|
2010-05-01 11:25:12 +02:00
|
|
|
|
2020-11-18 15:49:05 +01:00
|
|
|
test_expect_success 'do not switch branches with dirty file' '
|
|
|
|
git reset --hard &&
|
|
|
|
git checkout other &&
|
|
|
|
echo dirt >file &&
|
|
|
|
git update-index --assume-unchanged file &&
|
2020-11-18 15:49:07 +01:00
|
|
|
test_must_fail git checkout - 2>err &&
|
|
|
|
test_i18ngrep overwritten err
|
2020-11-18 15:49:05 +01:00
|
|
|
'
|
2010-05-01 11:25:12 +02:00
|
|
|
|
|
|
|
test_done
|