Re: [PATCH] t: make many tests depend less on the refs being files
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- May 21, 2018, 11:49 UTC
- Message-ID
- <20180521114940.11288-1-szeder.dev@gmail.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.1805211126140.77@tvgsbejvaqbjf.bet>
Show 15 quoted lines
> > diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh > > index 8f5c811dd7..c3b89ae783 100755 > > --- a/t/t9903-bash-prompt.sh > > +++ b/t/t9903-bash-prompt.sh > > @@ -148,7 +148,7 @@ test_expect_success 'prompt - inside .git directory' ' > > test_expect_success 'prompt - deep inside .git directory' ' > > printf " (GIT_DIR!)" >expected && > > ( > > - cd .git/refs/heads && > > + cd .git/objects && > > __git_ps1 >"$actual" > > ) && > > test_cmp expected "$actual" > > This one looks wrong.
It's right, though.
> Why not `cd .git` instead?
That case is covered in the previous test.
Once upon a time it mattered how deep we were in the .git directory when running __git_ps1(), because it executed different branches of a long-ish if-elif chain. For the prompt it doesn't matter anymore, because those ifs were eliminated, but for the completion script it still does, which brings us to:
Christian! There is a similar test, '__git_find_repo_path - parent is a .git directory' in 't9902-completion.sh', which, too, performs a 'cd .git/refs/heads'.