t: skip pack tests if not using SHA-1
[gitweb.git] / xdiff / xemit.c
index c2d5bd004c72fc5361ea72884fb455be2281e260..7778dc2b190f84fe2ab1e1539756a7e1f4254c3b 100644 (file)
@@ -204,6 +204,9 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
                        }
 
                        fs1 = get_func_line(xe, xecfg, NULL, i1, -1);
+                       while (fs1 > 0 && !is_empty_rec(&xe->xdf1, fs1 - 1) &&
+                              !is_func_rec(&xe->xdf1, xecfg, fs1 - 1))
+                               fs1--;
                        if (fs1 < 0)
                                fs1 = 0;
                        if (fs1 < s1) {