interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t2106-update-index-assume-unchanged.sh

27 lines · 517 bytes Raw Blame History
1#!/bin/sh
2
3test_description='git update-index --assume-unchanged test.
4'
5
6. ./test-lib.sh
7
8test_expect_success 'setup' '
9 : >file &&
10 git add file &&
11 git commit -m initial &&
12 git branch other &&
13 echo upstream >file &&
14 git add file &&
15 git commit -m upstream
16'
17
18test_expect_success 'do not switch branches with dirty file' '
19 git reset --hard &&
20 git checkout other &&
21 echo dirt >file &&
22 git update-index --assume-unchanged file &&
23 test_must_fail git checkout - 2>err &&
24 test_grep overwritten err
25'
26
27test_done