diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-18 12:33:06 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-18 12:33:06 +0200 |
commit | 9946e0ce07c8d93a43bd7b8900ddf5d913fe3b03 (patch) | |
tree | 92bc467fe690a6d7efb3a28d5d0103eeb26fd292 /lib/git/objects/base.py | |
parent | a5cf1bc1d3e38ab32a20707d66b08f1bb0beae91 (diff) | |
download | gitpython-9946e0ce07c8d93a43bd7b8900ddf5d913fe3b03.tar.gz |
implemented diff tests, but will have to move the diff module as it needs to create objects, whose import would create a dependency cycle
Diffstat (limited to 'lib/git/objects/base.py')
-rw-r--r-- | lib/git/objects/base.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/git/objects/base.py b/lib/git/objects/base.py index 1bb2e8f1..b347b5f1 100644 --- a/lib/git/objects/base.py +++ b/lib/git/objects/base.py @@ -214,6 +214,9 @@ class Diffable(object): Note Rename detection will only work if create_patch is True """ + # import it in a retared fashion to avoid dependency cycle + from git.diff import Diff + args = list(self._diff_args[:]) args.append( "--abbrev=40" ) # we need full shas args.append( "--full-index" ) # get full index paths, not only filenames @@ -237,9 +240,9 @@ class Diffable(object): kwargs['as_process'] = True proc = self.repo.git.diff(*args, **kwargs) - diff_method = diff.Diff._index_from_raw_format + diff_method = Diff._index_from_raw_format if create_patch: - diff_method = diff.Diff._index_from_patch_format(self.repo, proc.stdout) + diff_method = Diff._index_from_patch_format return diff_method(self.repo, proc.stdout) |