Commit Diff


commit - 5b9c302980f3cf3d8df39dad1c4fb33ec357b731
commit + 744e8ee85035203d79f9c02b4fc6f1f395508acc
blob - 299edaaa7cb4bd79a85927c2b2227807da10bdaa
blob + 87c5a67f9e4cc6b427ce4fc03a5c86faf9879f07
--- lib/diff.c
+++ lib/diff.c
@@ -117,11 +117,9 @@ get_diffstat(struct got_diffstat_cb_arg *ds, const cha
 	err = got_pathlist_insert(&pe, ds->paths, path, change);
 	if (err || pe == NULL) {
 		free(change);
-		if (err)
-			return err;
+		return err;
 	}
 
-	pe = RB_MAX(got_pathlist_head, ds->paths);
 	diffstat_field_width(&ds->max_path_len, &ds->add_cols, &ds->rm_cols,
 	    pe->path_len, change->add, change->rm);