Re: [PATCH] test: bisect-porcelain: fix location of files
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Dec 18, 2020, 15:36 UTC
- Message-ID
- <CAP8UFD0X5HR67T6msOhJwgAGKQfgW4JxH+pJprseBi9XAZ2rCw@mail.gmail.com>
- In-Reply-To
- <20201218151406.1193792-1-felipe.contreras@gmail.com>
On Fri, Dec 18, 2020 at 4:14 PM Felipe Contreras <felipe.contreras@gmail.com> wrote:
Show 9 quoted lines
> > Commit ba7eafe146 (t6030: explicitly test for bisection cleanup, > 2017-09-29) introduced checks for files in the $GIT_DIR directory, but > that variable is not always defined, and in this test file it's not. > > Therefore these checks always passed regardless of the presence of these > files (unless the user has some /BISECT_LOG file, for some reason). > > Let's check the files in the correct location.
This looks good to me, but...
Show 5 quoted lines
> index 34099160ed..6d5440d704 100755 > --- a/t/t6030-bisect-porcelain.sh > +++ b/t/t6030-bisect-porcelain.sh > @@ -926,14 +926,14 @@ test_expect_success 'git bisect reset cleans bisection state properly' ' > git bisect bad $HASH4 &&
...if we wanted this kind of bug not to happen again, we could add a test here, before `git bisect reset`, to check that here one of the files below actually exists.
Show 19 quoted lines
> git bisect reset && > test -z "$(git for-each-ref "refs/bisect/*")" && > - test_path_is_missing "$GIT_DIR/BISECT_EXPECTED_REV" && > - test_path_is_missing "$GIT_DIR/BISECT_ANCESTORS_OK" && > - test_path_is_missing "$GIT_DIR/BISECT_LOG" && > - test_path_is_missing "$GIT_DIR/BISECT_RUN" && > - test_path_is_missing "$GIT_DIR/BISECT_TERMS" && > - test_path_is_missing "$GIT_DIR/head-name" && > - test_path_is_missing "$GIT_DIR/BISECT_HEAD" && > - test_path_is_missing "$GIT_DIR/BISECT_START" > + test_path_is_missing ".git/BISECT_EXPECTED_REV" && > + test_path_is_missing ".git/BISECT_ANCESTORS_OK" && > + test_path_is_missing ".git/BISECT_LOG" && > + test_path_is_missing ".git/BISECT_RUN" && > + test_path_is_missing ".git/BISECT_TERMS" && > + test_path_is_missing ".git/head-name" && > + test_path_is_missing ".git/BISECT_HEAD" && > + test_path_is_missing ".git/BISECT_START" > '
Thanks, Christian.