Re: [PATCH v3 1/4] replace: add --graft option

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

 



On Fri, Jun 6, 2014 at 5:29 PM, Christian Couder
<christian.couder@xxxxxxxxx> wrote:
>
> Yeah, or I could just rely on the fact that lookup_commit_or_die()
> already parses the commit, with something like this:
>
>       if (get_sha1(old_ref, old) < 0)
>               die(_("Not a valid object name: '%s'"), old_ref);
>
>       /* parse the commit buffer to make sure the commit is not corrupt */
>       commit = lookup_commit_or_die(old, old_ref);
>
>       /* find existing parents */
>       parent_start = buf.buf;
>       parent_start += 46; /* "tree " + "hex sha1" + "\n" */
>       parent_end = parent_start;

This last part should be:

        /* find existing parents */
        strbuf_addstr(&buf, commit->buffer);
        parent_start = buf.buf;
        parent_start += 46; /* "tree " + "hex sha1" + "\n" */
        parent_end = parent_start;
...

I will send an updated patch series soon.
--
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]