Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15

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

From: Christian Couder <hidden>
Date: 2016-06-15 22:51:43

Hi Ram,

On Tue, Aug 2, 2011 at 6:54 AM, Ramkumar Ramachandra [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help