From: Karl Hasselström Date: Mon, 28 Jan 2008 23:11:59 +0000 (+0100) Subject: Teach new infrastructure to diff two trees X-Git-Tag: v0.15-rc1~280 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/2558895ab5657f2b1040a675604a41fce82e8b56 Teach new infrastructure to diff two trees Nothing uses this yet, but "stg edit" will soon. Signed-off-by: Karl Hasselström --- diff --git a/stgit/lib/git.py b/stgit/lib/git.py index 45879df..d75f724 100644 --- a/stgit/lib/git.py +++ b/stgit/lib/git.py @@ -356,6 +356,11 @@ class Repository(RunWithEnv): return None finally: index.delete() + def diff_tree(self, t1, t2, diff_opts): + assert isinstance(t1, Tree) + assert isinstance(t2, Tree) + return self.run(['git', 'diff-tree', '-p'] + list(diff_opts) + + [t1.sha1, t2.sha1]).raw_output() class MergeException(exception.StgException): pass