2010-05-01 09:25:12 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test_description='git update-index --assume-unchanged test.
|
|
|
|
'
|
|
|
|
|
2021-11-16 18:27:38 +00:00
|
|
|
TEST_PASSES_SANITIZE_LEAK=true
|
2010-05-01 09:25:12 +00:00
|
|
|
. ./test-lib.sh
|
|
|
|
|
2020-11-18 14:49:05 +00: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 09:25:12 +00:00
|
|
|
|
2020-11-18 14:49:05 +00: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 14:49:07 +00:00
|
|
|
test_must_fail git checkout - 2>err &&
|
|
|
|
test_i18ngrep overwritten err
|
2020-11-18 14:49:05 +00:00
|
|
|
'
|
2010-05-01 09:25:12 +00:00
|
|
|
|
|
|
|
test_done
|