32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
From c4963107ee97b6bf045b805ed3b8f9f824c62ccb Mon Sep 17 00:00:00 2001
|
|
From: Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
|
|
Date: Thu, 4 Apr 2013 14:47:19 +0100
|
|
Subject: [PATCH] Fix #628184 - Giggle does not display diff for files that
|
|
have spaces in names
|
|
|
|
Git diff is compliant to GNU patch expected format:
|
|
when a filename contains a SP a TAB is added.
|
|
See Git's commit 1a9eb3b9d50367bee8fe85022684d812816fe531
|
|
|
|
Signed-off-by: Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
|
|
---
|
|
src/giggle-diff-view.c | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
diff --git src/giggle-diff-view.c src/giggle-diff-view.c
|
|
index ff6bbe3..2fbb8eb 100644
|
|
--- src/giggle-diff-view.c
|
|
+++ src/giggle-diff-view.c
|
|
@@ -665,6 +665,11 @@ diff_view_parse_patch (GiggleDiffView *view)
|
|
}
|
|
} else if (g_str_has_prefix (line, "--- a/") || g_str_has_prefix (line, "+++ b/")) {
|
|
g_free (filename); filename = g_strdup (line + 6);
|
|
+ if (strchr(filename, ' ')) {
|
|
+ /* Remove trailing TAB added by git for GNU patch compatibility */
|
|
+ size_t len = strlen (filename);
|
|
+ filename[len-1] = '\0';
|
|
+ }
|
|
}
|
|
|
|
g_free (line);
|