From 7fce6e3c9a3cf652099ee5f0e52b59c407692044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 14 Dec 2009 18:43:59 +0700 Subject: commit: correctly respect skip-worktree bit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit b4d1690 (Teach Git to respect skip-worktree bit (reading part)) fails to make "git commit -- a b c" respect skip-worktree (i.e. not committing paths that are skip-worktree). This is because when the index is reset back to HEAD, all skip-worktree information is gone. This patch saves skip-worktree information in the string list of committed paths, then reuse it later on to skip skip-worktree paths. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- t/t7011-skip-worktree-reading.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/t7011-skip-worktree-reading.sh b/t/t7011-skip-worktree-reading.sh index e996928de..bb4066f76 100755 --- a/t/t7011-skip-worktree-reading.sh +++ b/t/t7011-skip-worktree-reading.sh @@ -148,13 +148,13 @@ test_expect_success 'git-rm succeeds on skip-worktree absent entries' ' git rm 1 ' -test_expect_failure 'commit on skip-worktree absent entries' ' +test_expect_success 'commit on skip-worktree absent entries' ' git reset && setup_absent && test_must_fail git commit -m null 1 ' -test_expect_failure 'commit on skip-worktree dirty entries' ' +test_expect_success 'commit on skip-worktree dirty entries' ' git reset && setup_dirty && test_must_fail git commit -m null 1 -- cgit v1.2.1