From: Catalin Marinas Date: Sun, 9 Dec 2007 23:32:58 +0000 (+0000) Subject: Better handling of binary files (bug #8495) X-Git-Tag: v0.14~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/ed9256cea646a5384fb258eb9a3610b112a78a90 Better handling of binary files (bug #8495) The patch adds the '--binary' option to the git-diff-tree and git-diff-index commands. The git-apply no longer needs this flag as it is set by default. Signed-off-by: Catalin Marinas --- diff --git a/stgit/git.py b/stgit/git.py index 27d2595..deb5efc 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -767,11 +767,14 @@ def merge(base, head1, head2, recursive = False): if errors: raise GitException, 'GIT index merging failed (possible conflicts)' -def diff(files = None, rev1 = 'HEAD', rev2 = None, diff_flags = []): +def diff(files = None, rev1 = 'HEAD', rev2 = None, diff_flags = [], + binary = True): """Show the diff between rev1 and rev2 """ if not files: files = [] + if binary and '--binary' not in diff_flags: + diff_flags = diff_flags + ['--binary'] if rev1 and rev2: return GRun('diff-tree', '-p',