diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2012-01-12 15:23:39 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-01-15 19:51:54 +0100 |
commit | 835e3cab33689550b52513db32cb3feef853bef3 (patch) | |
tree | 9d302d6b97706cb0358a7a2e519eb54fc3b63bfb /gbp/git/repository.py | |
parent | 16a2cd36e60a9241aeff01e923c0b77f7913ce7c (diff) |
GitRepository: add diff()
Diff two git repository objects (tag, commit, tree or blob).
Diffstat (limited to 'gbp/git/repository.py')
-rw-r--r-- | gbp/git/repository.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 3c798969..bbae8547 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1084,6 +1084,21 @@ class GitRepository(object): args += [ '-p', strip ] args.append(patch) self._git_command("apply", args) + + def diff(self, obj1, obj2): + """ + Diff two git repository objects + + @param obj1: first object + @type types: C{str} + @param obj2: second object + @type types: C{str} + @return: diff + @rtype: C{str} + """ + options = GitArgs(obj1, obj2) + output, ret = self.__git_getoutput('diff', options.args) + return output #} def archive(self, format, prefix, output, treeish, **kwargs): |