Re: [PATCH 1/2] t1415: avoid using `main` as ref name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jonathan,

On Mon, 5 Oct 2020, Jonathan Nieder wrote:

>
> Johannes Schindelin wrote:
>
> > In preparation for a patch series that will change the fall-back for
> > `init.defaultBranch` to `main`, let's not use `main` as ref name in
> > this test script.
>
> Interesting.  I assume the issue is this line?
>
> 	-	git -C fer1/repo for-each-ref --format="%(refname)" | grep main >actual &&
>
> I.e., it's not actually that naming a worktree "main" will break
> anything, but just that the test catches refs/heads/main in the same
> net when it does grepping?

Right.

> If the commit message explains that, then this patch looks good to me.
> Without such an explanation, it would make me fear that we have some
> underlying bug in "git worktree".

Indeed. This is my current revision of the commit message:

    t1415: avoid using `main` as ref name

    In preparation for a patch series that will change the fall-back for
    `init.defaultBranch` to `main`, let's not use `main` as ref name in this
    test script.

    Otherwise, the `git for-each-ref ... | grep main` which wants to catch
    those refs would also unexpectedly catch `refs/heads/main`.

    Since the refs in question are worktree-local ones (i.e. each worktree
    has their own, just like `HEAD`), and since the test case already uses a
    secondary worktree called "second", let's use the name "first" for those
    refs instead.

    While at it, adjust the test titles that talk about a "repo" when they
    meant a "worktree" instead.

Ciao,
Dscho




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux