# Breaking t1510-repo-setup.sh tests in pu

4 messages from 2010-11-25 to 2010-11-26. Participants: Ævar Arnfjörð Bjarmason, Nguyen Thai Ngoc Duy, Johannes Sixt.
Thread: https://gitlist.dev/t/25838

## Ævar Arnfjörð Bjarmason, 2010-11-25 09:56

Subject: Breaking t1510-repo-setup.sh tests in pu
Message-ID: <AANLkTim=_0WiphBv-RBhJ2i9rGzXvz8yKcZcm_7pYXFc@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTim%3D_0WiphBv-RBhJ2i9rGzXvz8yKcZcm_7pYXFc%40mail.gmail.com

```
I haven't investigated these. But that test is breaking in pu now:

    $ prove ./t1510-repo-setup.sh
    ./t1510-repo-setup.sh .. Dubious, test returned 1 (wstat 256, 0x100)
    Failed 244/376 subtests

    Test Summary Report
    -------------------
    ./t1510-repo-setup.sh (Wstat: 256 Tests: 376 Failed: 244)
      Failed tests:  8-9, 11, 15-36, 46-67, 71-92, 101, 103
                    113-128, 144-159, 169-184, 207-208, 211-234
                    256-279, 281-282, 284-307, 320-343, 351
                    353-376
      Non-zero exit status: 1
    Files=1, Tests=376,  8 wallclock secs ( 0.23 usr  0.02 sys +  0.85
cusr  5.26 csys =  6.36 CPU)
    Result: FAIL

All the breakages seem to be due to path differences:

    --- expected    2010-11-25 09:53:46.000000000 +0000
    +++ result      2010-11-25 09:53:46.000000000 +0000
    @@ -1,4 +1,4 @@
    -setup: git_dir: /home/avar/g/git/t/trash directory.t1510-repo-setup/3/.git
    -setup: worktree: /home/avar/g/git/t/trash directory.t1510-repo-setup/3/wt
    +setup: git_dir: .git
    +setup: worktree: /home/avar/g/git/t/trash directory.t1510-repo-setup/3
     setup: cwd: /home/avar/g/git/t/trash directory.t1510-repo-setup/3
     setup: prefix: (null)
    not ok - 24 #3: GIT_DIR, GIT_WORK_TREE=wt at root

This is probably due to Nguyễn's recent work. But I'm not sure.

```

## Nguyen Thai Ngoc Duy, 2010-11-25 11:40

Subject: Re: Breaking t1510-repo-setup.sh tests in pu
Message-ID: <AANLkTikvXhKoRg4a0FuyW8cG45b6AM9+NbbHuJQWtb4L@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikvXhKoRg4a0FuyW8cG45b6AM9%2BNbbHuJQWtb4L%40mail.gmail.com
In-Reply-To: <AANLkTim=_0WiphBv-RBhJ2i9rGzXvz8yKcZcm_7pYXFc@mail.gmail.com>

```
2010/11/25 Ævar Arnfjörð Bjarmason <avarab@gmail.com>:
> All the breakages seem to be due to path differences:
>
>    --- expected    2010-11-25 09:53:46.000000000 +0000
>    +++ result      2010-11-25 09:53:46.000000000 +0000
>    @@ -1,4 +1,4 @@
>    -setup: git_dir: /home/avar/g/git/t/trash directory.t1510-repo-setup/3/.git
>    -setup: worktree: /home/avar/g/git/t/trash directory.t1510-repo-setup/3/wt
>    +setup: git_dir: .git
>    +setup: worktree: /home/avar/g/git/t/trash directory.t1510-repo-setup/3
>     setup: cwd: /home/avar/g/git/t/trash directory.t1510-repo-setup/3
>     setup: prefix: (null)
>    not ok - 24 #3: GIT_DIR, GIT_WORK_TREE=wt at root
>
> This is probably due to Nguyễn's recent work. But I'm not sure.
>

Interesting. That looks like real breakage. I have just run the tests
on pu (f4b0626). It passed. Can you send me the entire log and
/tmp/t1510-trace.log after applying this patch?

diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh
index 0343045..446eb4d 100755
--- a/t/t1510-repo-setup.sh
+++ b/t/t1510-repo-setup.sh
@@ -4,6 +4,8 @@ test_description='Tests of cwd/prefix/worktree/gitdir
setup in all cases'

 . ./test-lib.sh

+export GIT_TRACE=/tmp/t1510-trace.log
+
 #
 # A few rules for repo setup:
 #
-- 
Duy

```

## Nguyen Thai Ngoc Duy, 2010-11-26 02:45

Subject: Re: Breaking t1510-repo-setup.sh tests in pu
Message-ID: <AANLkTim1G__J6KAnd+pNmKWwEDTHexUSJU2E7=7WFZmp@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTim1G__J6KAnd%2BpNmKWwEDTHexUSJU2E7%3D7WFZmp%40mail.gmail.com
In-Reply-To: <AANLkTinhgMhrcMtPKL0aOrkeVgo8NE8Sq0fuPuCcbdbq@mail.gmail.com>

```
On Fri, Nov 26, 2010 at 8:21 AM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> On Thu, Nov 25, 2010 at 12:40, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
>> Interesting. That looks like real breakage. I have just run the tests
>> on pu (f4b0626). It passed. Can you send me the entire log and
>> /tmp/t1510-trace.log after applying this patch?
>
> Here it is. Hope it's useful.
>

OK it's probably bashisms. I think it will pass if you run it with
bash :-P I'll resend the series later without bash specific
constructs.
-- 
Duy

```

## Johannes Sixt, 2010-11-26 07:51

Subject: Re: Breaking t1510-repo-setup.sh tests in pu
Message-ID: <4CEF66E8.1050806@viscovery.net>
URL: https://gitlist.dev/e/4CEF66E8.1050806%40viscovery.net
In-Reply-To: <AANLkTim1G__J6KAnd+pNmKWwEDTHexUSJU2E7=7WFZmp@mail.gmail.com>

```
Am 11/26/2010 3:45, schrieb Nguyen Thai Ngoc Duy:
> OK it's probably bashisms. I think it will pass if you run it with
> bash :-P I'll resend the series later without bash specific
> constructs.

Sure, it is. This:

   GIT_DIR="$TRASH_DIRECTORY/2/.git" test_repo 2/sub

does not work the same way in all shells when test_repo is a shell
function. You have to export GIT_DIR explicitly before the function call.
(But since in this case, test_repo invokes its own subshell anyway, you
better do it in the function.)

-- Hannes

```
