Merge branch 'maint'
[gitweb.git] / builtin / diff.c
index 387afa75680d813bccd5493e5946600c08679890..9069dc41be33a362ff04d52c00b4830eed272826 100644 (file)
@@ -285,6 +285,10 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
        /* Otherwise, we are doing the usual "git" diff */
        rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index;
 
+       /* Scale to real terminal size and respect statGraphWidth config */
+       rev.diffopt.stat_width = -1;
+       rev.diffopt.stat_graph_width = -1;
+
        /* Default to let external and textconv be used */
        DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL);
        DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
@@ -323,7 +327,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
                                add_head_to_pending(&rev);
                                if (!rev.pending.nr) {
                                        struct tree *tree;
-                                       tree = lookup_tree((const unsigned char*)EMPTY_TREE_SHA1_BIN);
+                                       tree = lookup_tree(EMPTY_TREE_SHA1_BIN);
                                        add_pending_object(&rev, &tree->object, "HEAD");
                                }
                                break;