From: Jonas Fonseca Date: Wed, 09 Jun 2010 16:10:12 GMT Subject: Re: [PATCH] Improve parent blame to detect renames by using the previous information Message-ID: In-Reply-To: <20100606223545.GA11424@coredump.intra.peff.net> On Sun, Jun 6, 2010 at 18:35, Jeff King wrote: > > On Sat, Jun 05, 2010 at 03:56:05PM -0400, Jonas Fonseca wrote: > > One minor bug: > > > @@ -5204,10 +5148,13 @@ blame_request(struct view *view, enum request request, struct line *line) > >               break; > > > >       case REQ_PARENT: > > -             if (check_blame_commit(blame, TRUE) && > > -                 select_commit_parent(blame->commit->id, opt_ref, > > -                                      blame->commit->filename)) { > > -                     string_copy(opt_file, blame->commit->filename); > > +             if (!check_blame_commit(blame, TRUE)) > > +                     break; > > +             if (!*blame->commit->parent_id) { > > +                     report("The selected commit has no parents"); > > +             } else { > > +                     string_copy_rev(opt_ref, blame->commit->parent_id); > > +                     string_copy_rev(opt_file, blame->commit->parent_filename); > > This second string_copy_rev should be a string_ncopy, shouldn't it? Oh, yes, a regular copy and paste bug. Thanks for noticing. I will include this and consider tagging another release. -- Jonas Fonseca