Code

diff --no-index: do not forget to run diff_setup_done()
authorJunio C Hamano <gitster@pobox.com>
Fri, 14 Sep 2007 19:12:32 +0000 (12:12 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Sep 2007 19:12:32 +0000 (12:12 -0700)
Code inspection by Linus found this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-lib.c

index f5568c3b36338a203a42ce1e46109152ad4642bb..da5571302df6ed418874fd4d7423853a7de5b52c 100644 (file)
@@ -298,6 +298,8 @@ int setup_diff_no_index(struct rev_info *revs,
        revs->diffopt.nr_paths = 2;
        revs->diffopt.no_index = 1;
        revs->max_count = -2;
+       if (diff_setup_done(&revs->diffopt) < 0)
+               die("diff_setup_done failed");
        return 0;
 }