Subject: Re: [PATCH v3] pull, fetch: fix segfault in --set-upstream option

From: Junio C Hamano <[email-masked]>
Date: Mon, 30 Aug 2021 10:46:48 -0700

Ævar Arnfjörð Bjarmason  <[email-masked]> writes:

> There was an earlier submitted alternate way of fixing this in [1],
> due to that patch breaking threading with the original report at [2] I
> didn't notice it before authoring this version. I think the more
> detailed warning message here is better, and we should also have tests
> for this behavior.

I do not think it is necessarily an improvement to give more info,
if it is irrelevant to explain what the error is.  And the point of
the error message here is that we cannot set the upstream of
detached HEAD, no matter what the value of old source ref or new
source ref are.

The original from Clemens gives a warning message that omits the
piece of information that does not contribute to the error.

Testing the new behaviour is a good idea.  I also agree with you
that die() would be more appropriate and does not risk regression,
if the original behaviour was to segfault.

Thanks.