#976354 git - tests fail with dash

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
Bastian Blank
Date:
2021-02-14 18:48:02 UTC
Severity:
important
#976354#5
Date:
2020-12-03 21:14:10 UTC
From:
To:
Some of the tests fail with dash, which is the default /bin/sh in
Debian.

Example:

| bbl@debian-sid:~/git-2.29.2+next.20201030/t$ bash ./t3070-wildmatch.sh | tail -n 3
| # still have 40 known breakage(s)
| # passed all remaining 1850 test(s)
| 1..1890
| bbl@debian-sid:~/git-2.29.2+next.20201030/t$ dash ./t3070-wildmatch.sh | tail -n 3
| # still have 28 known breakage(s)
| # failed 12 among remaining 1862 test(s)
| 1..1890

I was not able to see where exactly it's broken, but the result changes
with various options, so it might be a breakage in dash itself.

The easiest solution is to just use /bin/bash always.

Bastian

#976354#10
Date:
2021-02-04 18:15:29 UTC
From:
To:
The test scripts include test-lib.sh, which deliberately assumes bash.
# checkbashisms test-lib.sh

possible bashism in test-lib.sh line 381 ($BASH_SOMETHING):
         if test -n "$BASH_VERSION" && eval '
This part happens to work for other shells, but the comments around it
suggest that the intent is only to check the bash version.

possible bashism in test-lib.sh line 1491 (builtin):
         builtin pwd -W
The 'builtin' builtin only exists in bash.

So I suggest to apply Bastian’s suggestion:
# sed -i '1 s_^#!/bin/sh$_#!/bin/bash_' t/t*.sh

#976354#15
Date:
2021-02-08 16:57:49 UTC
From:
To:
Hi Bastian,

Why did you file this bug as serious? As noted in #972457, the build seems to
succeed (my tests where done with /bin/sh pointing to dash).

Cheers,

Ivo