Git::SVN{,::Ra}: canonicalize earlier
[gitweb.git] / combine-diff.c
index cfe62303a8634cb68c5f671c147efe97a5aca273..978668036835e16df4b6bfd37a7b1e9f8494cf07 100644 (file)
@@ -423,7 +423,7 @@ static int make_hunks(struct sline *sline, unsigned long cnt,
                                                     hunk_begin, j);
                                la = (la + context < cnt + 1) ?
                                        (la + context) : cnt + 1;
-                               while (j <= --la) {
+                               while (la && j <= --la) {
                                        if (sline[la].flag & mark) {
                                                contin = 1;
                                                break;
@@ -1196,10 +1196,9 @@ void diff_tree_combined(const unsigned char *sha1,
        }
 }
 
-void diff_tree_combined_merge(const unsigned char *sha1,
-                            int dense, struct rev_info *rev)
+void diff_tree_combined_merge(const struct commit *commit, int dense,
+                             struct rev_info *rev)
 {
-       struct commit *commit = lookup_commit(sha1);
        struct commit_list *parent = commit->parents;
        struct sha1_array parents = SHA1_ARRAY_INIT;
 
@@ -1207,6 +1206,6 @@ void diff_tree_combined_merge(const unsigned char *sha1,
                sha1_array_append(&parents, parent->item->object.sha1);
                parent = parent->next;
        }
-       diff_tree_combined(sha1, &parents, dense, rev);
+       diff_tree_combined(commit->object.sha1, &parents, dense, rev);
        sha1_array_clear(&parents);
 }