From 9ad70f8064a4e4e08bf8d62d962e2b9f088a8951 Mon Sep 17 00:00:00 2001 From: Sverre Rabbelier Date: Sun, 20 Jul 2008 21:31:11 +0200 Subject: [PATCH] gitstats: Bugfix for diff.py, don't die on empty diffs With the rewrite of the _splitFileDiff routine the default was changed. The original behaviorwhen a diff with no hunks was passed, was to 'eat' the entire content and return an empty diff. This commit restores that behavior by setting the size initially to the entire content. Bug-introduced-in: 00a3c465c01e335317857e47f02fdeb93c79a052 --- src/git_stats/diff.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/git_stats/diff.py b/src/git_stats/diff.py index ab17cd9..b3e35cb 100644 --- a/src/git_stats/diff.py +++ b/src/git_stats/diff.py @@ -86,6 +86,8 @@ def _splitFileDiff(diff): header = [] chunk = [] + start = len(diff) + # Find out where the header stops for i, line in enumerate(diff): if line.startswith("@@"): -- 2.11.4.GIT