Code

Oops, always specify --no-color when using git diff
authorJonas Fonseca <fonseca@diku.dk>
Fri, 23 Jan 2009 11:23:29 +0000 (12:23 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Fri, 23 Jan 2009 11:23:29 +0000 (12:23 +0100)
tig.c

diff --git a/tig.c b/tig.c
index e6e44d3c1938c1a92f29c1ec9cd8b74b3afd13ac..88338d0f2832b59f6390d56a8f100efe0bac948a 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -4165,12 +4165,13 @@ blame_request(struct view *view, enum request request, struct line *line)
                if (!strcmp(blame->commit->id, NULL_ID)) {
                        struct view *diff = VIEW(REQ_VIEW_DIFF);
                        const char *diff_index_argv[] = {
-                               "git", "diff-index", "--patch-with-stat", "-C",
-                                       "-M", "HEAD", "--", view->vid, NULL
+                               "git", "diff-index", "--root", "--patch-with-stat",
+                                       "-C", "-M", "HEAD", "--", view->vid, NULL
                        };
 
                        if (!blame->commit->has_previous) {
                                diff_index_argv[1] = "diff";
+                               diff_index_argv[2] = "--no-color";
                                diff_index_argv[5] = "--";
                                diff_index_argv[6] = "/dev/null";
                        }