mirror of
https://github.com/git/git.git
synced 2024-12-03 23:14:23 +08:00
aecda37c66
A merge will fail gracefully if it needs to update files marked
"assume unchanged", but other similar commands will not. In
particular, checkout and rebase will silently overwrite changes to
such files.
This is a regression introduced in commit 1dcafcc0
(verify_uptodate():
add ce_uptodate(ce) test), which avoids lstat's during a merge, if the
index entry is up-to-date. If the CE_VALID flag is set, however, we
cannot trust CE_UPTODATE.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
25 lines
496 B
Bash
Executable File
25 lines
496 B
Bash
Executable File
#!/bin/sh
|
|
|
|
test_description='git update-index --assume-unchanged test.
|
|
'
|
|
|
|
. ./test-lib.sh
|
|
|
|
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'
|
|
|
|
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 &&
|
|
test_must_fail git checkout master'
|
|
|
|
test_done
|