Re: [BUG?] HEAD detached at HEAD

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

 



Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx> writes:

> ... in addition to my previous reply, looking at more context:
>
>>> --- a/wt-status.c
>>> +++ b/wt-status.c
>>> @@ -1319,6 +1319,13 @@ static int grab_1st_switch(unsigned char *osha1, unsigned char *nsha1,
>>>         hashcpy(cb->nsha1, nsha1);
>>>         for (end = target; *end && *end != '\n'; end++)
>>>                 ;
>>> +       if (!memcmp(target, "HEAD", end - target)) {
>>> +               /* Don't say "HEAD detached at HEAD" */
>>> +               unsigned char head[GIT_SHA1_RAWSZ];
>>> +               get_sha1("HEAD", head);
>>> +               strbuf_addstr(&cb->buf, find_unique_abbrev(head, DEFAULT_ABBREV));
>>> +               return 1;
>>> +       }
>>>         strbuf_add(&cb->buf, target, end - target);
>>>         return 1;
>>>  }
>>>
>>> What do you think?
>
> I think we should return (the hex repr. of) nsha1 instead of resolving
> HEAD at its current state. That should solve the present problem (and
> leave the more difficult reflog issue for the future).

Indeed, resolving HEAD to its current state is wrong. I'll submit a
proper patch soon.

Thanks,

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]