From: Junio C Hamano Date: Wed, 30 Oct 2019 01:16:08 GMT Subject: Re: [PATCH v2 2/2] stash: handle staged changes in skip-worktree files correctly Message-ID: In-Reply-To: <9835e66399b5feeb3313bcee62f0519c025a4ca2.1572261615.git.gitgitgadget@gmail.com> "Johannes Schindelin via GitGitGadget" writes: > From: Johannes Schindelin > > When calling `git stash` while changes were staged for files that are > marked with the `skip-worktree` bit (e.g. files that are excluded in a > sparse checkout), the files are recorded as _deleted_ instead. Good. Much easier to see what is going on than the verb "lose" used in the cover letter of v1 that puzzled me. > However, when the temporary index is updated via `git update-index --add > --remove`, skip-worktree entries mark the files as deleted by mistake. > > Let's use the newly-introduced `--ignore-skip-worktree-entries` option > of `git update-index` to prevent exactly this from happening. Good. > Note that the regression test case deliberately avoids replicating the > scenario described above and instead tries to recreate just the symptom. That's good. Testing the end-user visible effect is just as important as the narrowly pointed root-cause test like the one in the previous patch. Thanks.