Re: [PATCH 3/5] reset: support the --pathspec-from-file option
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Nov 5, 2019, 19:22 UTC
- Message-ID
- <af4ecf54-6353-2307-5905-624919e78683@gmail.com>
- In-Reply-To
- <b93592df-561f-36d4-09ce-e02d570c60da@gmail.com>
Hi Alexandr
On 05/11/2019 15:03, Phillip Wood wrote:
Show 11 quoted lines
> [...] >> +test_expect_success 'quotes' ' >> + restore_checkpoint && >> + >> + git rm fileA.t && >> + printf "\"file\\101.t\"" | git reset --pathspec-from-file=- && >> + >> + verify_state expect.a > > If I've understood correctly this doesn't test if a path is correctly > unquoted, only that it is accepted.
Oh I think I've misunderstood. The '\\' in unquoted by printf, so git sees '\101' which is A so that is a real file.
Sorry for the confusion
Phillip
Show 45 quoted lines
> >> +' >> + >> +test_expect_success 'quotes not compatible with --pathspec-file-null' ' >> + restore_checkpoint && >> + >> + git rm fileA.t && >> + printf "\"file\\101.t\"" >list && >> + # Note: "git reset" has not yet learned to fail on wrong pathspecs >> + git reset --pathspec-from-file=list --pathspec-file-null && >> + >> + test_must_fail verify_state expect.a >> +' >> + >> +test_expect_success '--pathspec-from-file is not compatible with >> --soft --hard' ' > > s/--soft --hard/--soft or --hard/ > >> + restore_checkpoint && >> + >> + git rm fileA.t && >> + echo fileA.t >list && >> + test_must_fail git reset --soft --pathspec-from-file=list && >> + test_must_fail git reset --hard --pathspec-from-file=list >> +' >> + >> +test_expect_success 'only touches what was listed' ' > > s/^/--pathspec-from-file / ? > > Best Wishes > > Phillip > >> + restore_checkpoint && >> + >> + git rm fileA.t fileB.t fileC.t fileD.t && >> + printf "fileB.t\nfileC.t" | git reset --pathspec-from-file=- && >> + >> + verify_state expect.a_bc_d >> +' >> + >> +test_done >>