Re: [RFC/ PATCH] revert: Allow arbitrary sequencer instructions

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

 



Hi Ram,

On Tue, Aug 2, 2011 at 6:54 AM, Ramkumar Ramachandra <artagnon@xxxxxxxxx> wrote:
>
>        if (get_sha1(sha1_abbrev, commit_sha1) < 0)
>                return NULL;
>
> -       return lookup_commit_reference(commit_sha1);
> +       commit = lookup_commit_reference(commit_sha1);
> +       if (commit) {
> +               insn = xmalloc(sizeof(struct replay_insn));
> +               insn->commit = commit;
> +               insn->action = action;
> +               return insn;
> +       }
> +       return NULL;
>  }

I'd suggest:

       commit = lookup_commit_reference(commit_sha1);
       if (!commit)
               return NULL;

       insn = xmalloc(sizeof(struct replay_insn));
       insn->commit = commit;
       insn->action = action;
       return insn;

Thanks,
Christian.
--
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]