Re: Bad error message

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

 



"Robin Rosenberg (list subscriber)"  <robin.rosenberg.lists@xxxxxxxxxx> writes:

> @@ -43,8 +43,13 @@
>                 die("No such ref: %s", refname);
>
>         if (oldval) {
> -               if (memcmp(currsha1, oldsha1, 20))
> -                       die("Ref %s is at %s but expected %s", refname, sha1_to_hex(currsha1), sha1_to_hex(oldsha1));
> +               if (memcmp(currsha1, oldsha1, 20)) {
> +                       char sha1str1[41];
> +                       char sha1str2[41];
> +                       strcpy(sha1str1, sha1_to_hex(currsha1));
> +                       strcpy(sha1str2, sha1_to_hex(oldsha1));
> +                       die("Ref %s is at %s but expected %s", refname, sha1str1, sha1str2);
> +               }

Your patch looks correct, but probably is made unnecessary with
the "you can use up to 4 sha1_to_hex() safely" patch Linus did.

We have it in "master" and my plan is to cherry-pick it to
"maint" branch and included it in the next stale release 1.3.3,
along with core.prefersymlinkrefs patch also only in "master",
if we do not hear somebody scream in the next few days.

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