Re: [PATCH] t3200: clean side effect of git checkout --orphan

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

 



Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:

> On Sat, Aug 29, 2020 at 6:57 PM Aaron Lipman <alipman88@xxxxxxxxx> wrote:
>> The "refuse --edit-description on unborn branch for now" test in t3200
>> switches to an orphan branch, causing subsequent git commands
>> referencing HEAD to fail. Avoid this side-effect by switching back to
>> master after that test finishes.
>>
>> This has gone undetected, as the next effected test expects failure -
>> but it currently fails for the wrong reason.
>
> s/effected/affected
>
> In fact, the three tests following the orphan test all expect failure
> (though I didn't check if they also fail for the wrong reason), and
> the following test which doesn't expect failure has an explicit "git
> checkout master" early on, which explains why it was not impacted by
> this problem.
>
>> Verbose output of the next test referencing HEAD,
>> "--merged is incompatible with --no-merged":
>>
>>   fatal: malformed object name HEAD
>>
>> Which this commit corrects to:
>>
>>   error: option `no-merged' is incompatible with --merged
>>
>> Signed-off-by: Aaron Lipman <alipman88@xxxxxxxxx>
>
> Description and actual fix make perfect sense.

Yeah, looks good.  Of course, the affected test can be made more
defensive to protect the precondition it relies on from getting
broken by other tests (i.e. if it refers to HEAD, it should make
sure it is on an actual commit).   Each test cleaning up after
itself is a good discipline to have, but what is "clean" is quite
subjective and depends on each test piece in the script X-<.

Thanks, will queue.



[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