Skip to content

Add an output_nostrip kwarg to Git.execute #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 103 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
8af9416
Moved push and fetch methods partly from remote to the gitcmdobjdb im…
Byron Apr 5, 2011
e77d2d0
Removed all parts of the reference implementation which doesn't requi…
Byron Apr 7, 2011
a12a761
Updated objects to use the ones defined in gitdb as basis. Only the s…
Byron Apr 7, 2011
a80f9af
configparser is now part of gitdb. Test still remains until it was re…
Byron Apr 25, 2011
3fe1a7f
Moved rev_parse code into gitdb, this probably broke pretty much here…
Byron Apr 29, 2011
9fc7b9a
Made most primal imports work, but stopped here as there are many mor…
Byron May 5, 2011
f54546a
Added async submodule, formerly required by gitdb (which is still a v…
Byron May 5, 2011
4177eef
Added all code from gitdb to gitpython. Next is to make it generally …
Byron May 5, 2011
56da804
removed gitdb submodule
Byron May 6, 2011
acf5e6e
replaced all gitdb strings with git
Byron May 6, 2011
7ae36c3
Started to fix imports - tests still have no chance to work as databa…
Byron May 6, 2011
cd26aae
Made repository paths methods a property to be compatible with the ex…
Byron May 10, 2011
0996049
Intermediate commit with quite some progress in order to put all extr…
Byron May 29, 2011
112bb16
Finished moving all repository methods to the respective interfaces a…
Byron May 29, 2011
024adf3
Fixed tests far enough to allow basic repository tests to be applied …
Byron May 30, 2011
1f71ed9
git cmd implementation of repository appears to work, at least this i…
Byron May 30, 2011
4ea529d
Fixed pure python implementation to run the default repository tests
Byron May 30, 2011
09a11c7
Fixed test_git.py
Byron May 30, 2011
2bfc2e9
Fixed test_loose.py
Byron May 30, 2011
c192638
Fixed all remaining python repository tests
Byron May 30, 2011
7fab60c
Fixed all of the object tests, except for the submodule handling whic…
Byron May 30, 2011
6f96058
Fixed remaining tests as good as possible. remote/fetch/pull and subm…
Byron May 30, 2011
4298468
Fixed ref-log related issue in the test suite to assure it will not g…
Byron Jun 1, 2011
cee55cb
Fixed symref tests to work on osx
Byron Jun 1, 2011
5426890
Fixed odb performance tests
Byron Jun 6, 2011
d103257
Fixed packed ODB test, in preparation for separating the type to allo…
Byron Jun 6, 2011
155158e
Added PackedDB test with generalized type to allows other implementat…
Byron Jun 6, 2011
47f14d5
Added loose object writing and reading performance tessts, in pure an…
Byron Jun 6, 2011
79b9dbd
Fixed performance commit object testing
Byron Jun 6, 2011
56a004b
Moved performance commit object test into the respective subfolder to…
Byron Jun 6, 2011
ce79835
Fixed performance pack writing tests. As they are actually depent on …
Byron Jun 6, 2011
a5497c4
Streams returned by git cmd db are now containing all the data right …
Byron Jun 6, 2011
3c12de3
Improved pack writing test to show that the pack generation can be li…
Byron Jun 6, 2011
65f2dd0
Fixed fetch/push/pull implementation. Next up is to integrate the con…
Byron Jun 7, 2011
63a0bbe
Added version_info property to git command
Byron Jun 7, 2011
09517bd
clone and clone_from methods now support the RemoteProgress interface…
Byron Jun 7, 2011
9bf3fde
First run in order to fix the remote handling. Cleaned up interfaces …
Byron Jun 7, 2011
93668b0
Fixed index checkout return code parsing to work with latest git version
Byron Jun 7, 2011
f7ca1ce
Submodule tests are nearly working. Only root module needs more atten…
Byron Jun 7, 2011
82793e5
Submodule tests are fully back and working
Byron Jun 7, 2011
fd5c46e
submodule now doesn't use hardcoded repository implementations anymor…
Byron Jun 7, 2011
410cf1e
The --progress flag will now automatically be used if possible when d…
Byron Jun 7, 2011
4786d19
Making comparisons with non-GitPython objects more tolerant.
May 19, 2011
ecd0fd4
Match any number of leading spaces in config values
jkeating Feb 14, 2011
ba825ea
Greatly improved robustness of config parser - it can now take pretty…
Byron Jun 7, 2011
f6897c7
Added additional opcodes to remote progress to make it compatible to …
Byron Jun 7, 2011
58a930a
Merge branch 'gitdbmerger'
Byron Jun 7, 2011
90e780a
log: non-existing logs no longer throw an exception, but are ignored.…
Byron Jun 7, 2011
24bc841
git.version_info now returns exactly 4 numbers
Byron Jun 7, 2011
7bc59ab
Improved debug assertion to provide proper path on which to run a git…
Byron Jun 7, 2011
4772fe0
pre-emptively moved all reference related tests into own package, to …
Byron Jun 8, 2011
ee9d6b9
util: Added test for iterable list, and implemented __contains__ and …
Byron Jun 8, 2011
74b13c5
symbolic reference handles different types for comparison more gracef…
Byron Jun 8, 2011
095013f
Fixed critical issue that would cause a string to be passed to metho…
Byron Jun 8, 2011
7076f43
Fixed submodule tests to go with either the old or the new version of…
Byron Jun 10, 2011
e00bf79
root submodule: Added parent_commit parameter for convenience. Fixed …
Byron Jun 13, 2011
4bf372d
test_submodule: Will now load everything into memory if smmap is pres…
Byron Jun 13, 2011
963bbd7
Made remote line parsing more stable. On windows it can be that we en…
Byron Jun 13, 2011
5a3b731
Submodule now uses a specialized method to remove its trees to allow …
Byron Jun 13, 2011
6660f61
fixed submodule test to work on windows
Byron Jun 13, 2011
a7ff2f0
Fixed incorrect gitmodules file which used gitdb once again, instead …
Byron Jun 13, 2011
b7ae99c
Fixed implementation of _version_info which didn't work for python 2.…
Byron Jun 13, 2011
87aa78c
refs: added constructor flag to allow refs to be instatiated from any…
Byron Jul 4, 2011
87c7a6f
Basic remote functionality moved to Reference type, as it can in fact…
Byron Jul 4, 2011
3379127
Fetch info can now deal much better with non-default ref specs, see #…
Byron Jul 4, 2011
da12df9
Merge branch 'remote-fixes'
Byron Jul 4, 2011
d37ef77
Added smmap as submodule, package initialization adjusted to assure i…
Byron Jul 5, 2011
21499d9
util: added global sliding memory manager
Byron Jul 5, 2011
f0c05ea
util: pick the type of memory manager based on the python version, to…
Byron Jul 5, 2011
bf638fd
Merge branch 'smmap'
Byron Jul 5, 2011
6507e4e
fixes python 2.6 compatibility issues
Byron Jul 5, 2011
f1a2a4c
Implemented GIT_PYTHON_GIT_EXECUTABLE including test and docs
Byron Jul 5, 2011
2baf8a4
cmd: on windows, we will now fallback to using git.cmd, as the defaul…
Byron Jul 6, 2011
690828c
Added basis for initial dulwich integration. Many basic issues should…
Byron Jul 6, 2011
80aa405
Added auto-skip mixin metacls, some serious brainfuck, if the require…
Byron Jul 7, 2011
d5038eb
removed now superfluous InstanceDecorator, as it was just complicatin…
Byron Jul 7, 2011
4bb5107
Initial version of the DulwichType inheritance. For now, it inherits …
Byron Jul 7, 2011
8b3b222
Added default performance tests - these should help to measure someth…
Byron Jul 7, 2011
b56764b
Fixed submodule related issues once again - is it ever going to end ?
Byron Jul 7, 2011
0906450
Added trivial implementation for info and stream methods - info is ve…
Byron Jul 7, 2011
6a10c8a
Removed cache in PureCompoundDB as it had the tendency to slow things…
Byron Jul 7, 2011
f4f330f
Added store support. Now the basic object IO is implemented, which sh…
Byron Jul 7, 2011
023dc12
Merge branch 'dulwich'
Byron Jul 7, 2011
16a1327
Added basic frame for pygit2 - it just needs some basic methods to be…
Byron Jul 8, 2011
a5a0fa2
Fixed up tests to actually use pygit2. Its worth noting that the perf…
Byron Jul 8, 2011
a848569
Merge branch 'pygit2'
Byron Jul 8, 2011
6e86f8a
Fixed consecutive lines with same blame info not appearing in blame.
devnev Jul 17, 2011
f362d10
Fixed 'Inappropriate ioctl for device' problem on posix systems
swallat Feb 2, 2012
d78a82d
Added test for backslahed/quoted values
ereOn Feb 8, 2012
2b7975c
Fixed quotes and backslashes handling in GitConfigParser
ereOn Feb 8, 2012
3cadd6f
Fixed a case were values containing \\" were not properly escaped
ereOn Feb 8, 2012
cb68f36
Fix fd leak on git cmd.
sugi May 8, 2012
f467834
Ignore signal exception on AutoInterrupt destructor.
sugi May 8, 2012
95878d2
Merge pull request #58 from sugi/cmd-fd-leak-fix
Byron May 8, 2012
91c04a1
Merge pull request #43 from swallat/master
Byron May 17, 2012
cd72d78
Merge pull request #46 from ereOn/master
Byron May 30, 2012
8dc98aa
detect renames in "git diff --raw" output
Jun 15, 2012
3da67f3
add tests for git.diff.Diff._index_from_raw_format()
Jun 16, 2012
864cf1a
Merge pull request #62 from P2000/p2000
Byron Jun 16, 2012
6b5f70c
submodules now use the http protocol to faciliate use in corporate ne…
Jul 23, 2012
c08f435
Make GitPython work on non English systems
FlorianLudwig Jul 24, 2012
011d89d
Merge pull request #68 from FlorianLudwig/master
Byron Jul 24, 2012
0703be6
Add an output_nostrip kwarg to Git.execute
znerol Oct 12, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed tests far enough to allow basic repository tests to be applied …
…to any of the new database types. This reduces code duplication to the mere minimum, but allows custom tests to be added on top easily and flexibly
  • Loading branch information
Byron committed May 30, 2011
commit 024adf37acddd6a5d8293b6b5d15795c59a142c0
4 changes: 4 additions & 0 deletions doc/source/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ NEXT
* ### Module Changes ###

* Removed rev_parse function from git.repo.fun - the respective functionality is available only through the repository's rev_parse method, which might in turn translate to any implementation.

* ### Exceptions ###

* There is a new common base for all exceptions git-python will throw, namely `GitPythonError`.

0.3.1 Beta 2
============
Expand Down
6 changes: 4 additions & 2 deletions git/db/cmd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

from complex import *
# Copyright (C) 2010, 2011 Sebastian Thiel ([email protected]) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
2 changes: 1 addition & 1 deletion git/db/cmd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
bin_to_hex,
hex_to_bin
)
from git.db.compat import RepoCompatInterface
from git.db.compat import RepoCompatibilityInterface
from git.util import RemoteProgress
from git.db.interface import FetchInfo as GitdbFetchInfo
from git.db.interface import PushInfo as GitdbPushInfo
Expand Down
20 changes: 15 additions & 5 deletions git/db/cmd/complex.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
"""Module with our own git implementation - it uses the git command"""

from git.db.compat import RepoCompatInterface
from git.db.compat import RepoCompatibilityInterface
from git.db.py.complex import PureGitDB

from base import *


__all__ = ['GitCmdDB', 'CmdCompatibilityGitDB']
__all__ = ['GitCmdDB', 'CmdCompatibilityGitDB', 'CmdPartialGitDB']


class CmdGitDB( GitCommandMixin, CmdObjectDBRMixin, CmdTransportMixin,
CmdHighLevelRepository, PureGitDB):
class CmdPartialGitDB( GitCommandMixin, CmdObjectDBRMixin, CmdTransportMixin,
CmdHighLevelRepository ):
"""Utility repository which only partially implements all required methods.
It cannot be reliably used alone, but is provided to allow mixing it with other
implementations"""
pass

class CmdCompatibilityGitDB(CmdGitDB, RepoCompatInterface):

class CmdGitDB(CmdPartialGitDB, PureGitDB):
"""A database which fills in its missing implementation using the pure python
implementation"""
pass


class CmdCompatibilityGitDB(CmdGitDB, RepoCompatibilityInterface):
"""Command git database with the compatabilty interface added for 0.3x code"""
2 changes: 1 addition & 1 deletion git/db/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
"""Module providing adaptors to maintain backwards compatability"""

class RepoCompatInterface(object):
class RepoCompatibilityInterface(object):
"""Interface to install backwards compatability of the new complex repository
types with the previous, all in one, repository."""

Expand Down
8 changes: 4 additions & 4 deletions git/db/complex.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Module with many useful complex databases with different useful combinations of primary implementations"""

from py.complex import PureGitDB
from cmd.complex import CmdGitDB
from compat import RepoCompatInterface
from cmd.complex import CmdPartialGitDB
from compat import RepoCompatibilityInterface

__all__ = ['CmdGitDB', 'PureGitDB', 'PureCmdGitDB']
__all__ = ['CmdPartialGitDB', 'PureGitDB', 'PureCmdGitDB']

class PureCmdGitDB(PureGitDB, CmdGitDB, RepoCompatInterface):
class PureCmdGitDB(PureGitDB, CmdPartialGitDB, RepoCompatibilityInterface):
"""Repository which uses the pure implementation primarily, but falls back
to the git command implementation. Please note that the CmdGitDB does it
the opposite way around."""
2 changes: 0 additions & 2 deletions git/db/py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php

from complex import *
4 changes: 2 additions & 2 deletions git/db/py/complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ref import PureReferenceDB
from submodule import PureSubmoduleDB

from git.db.compat import RepoCompatInterface
from git.db.compat import RepoCompatibilityInterface

from git.util import (
LazyMixin,
Expand Down Expand Up @@ -123,6 +123,6 @@ def __init__(self, root_path):



class PureCompatibilityGitDB(PureGitDB, RepoCompatInterface):
class PureCompatibilityGitDB(PureGitDB, RepoCompatibilityInterface):
"""Pure git database with a compatability layer required by 0.3x code"""

13 changes: 10 additions & 3 deletions git/db/py/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@

from git.db.interface import ReferencesMixin
from git.exc import BadObject
from git.refs import SymbolicReference
from git.objects.base import Object
from git.objects.commit import Commit
from git.refs import (
SymbolicReference,
Reference,
HEAD,
Head,
TagReference
)
from git.refs.head import HEAD
from git.refs.headref import Head
from git.refs.tag import TagReference

from git.objects.base import Object
from git.objects.commit import Commit
from git.util import (
join,
isdir,
Expand Down
15 changes: 9 additions & 6 deletions git/exc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

from util import to_hex_sha

class ODBError(Exception):
class GitPythonError(Exception):
"""Base exception for all git-python related errors"""

class ODBError(GitPythonError):
"""All errors thrown by the object database"""


Expand Down Expand Up @@ -40,15 +43,15 @@ class UnsupportedOperation(ODBError):
"""Thrown if the given operation cannot be supported by the object database"""


class InvalidGitRepositoryError(Exception):
class InvalidGitRepositoryError(GitPythonError):
""" Thrown if the given repository appears to have an invalid format. """


class NoSuchPathError(OSError):
class NoSuchPathError(GitPythonError):
""" Thrown if a path could not be access by the system. """


class GitCommandError(Exception):
class GitCommandError(GitPythonError):
""" Thrown if execution of the git command fails with non-zero status code. """
def __init__(self, command, status, stderr=None):
self.stderr = stderr
Expand All @@ -60,7 +63,7 @@ def __str__(self):
(' '.join(str(i) for i in self.command), self.status, self.stderr))


class CheckoutError( Exception ):
class CheckoutError(GitPythonError):
"""Thrown if a file could not be checked out from the index as it contained
changes.

Expand All @@ -83,7 +86,7 @@ def __str__(self):
return Exception.__str__(self) + ":%s" % self.failed_files


class CacheError(Exception):
class CacheError(GitPythonError):
"""Base for all errors related to the git index, which is called cache internally"""


Expand Down
5 changes: 3 additions & 2 deletions git/index/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
)

from git.base import IStream
from git.db.py.mem import PureMemoryDB
from git.util import to_bin_sha
from itertools import izip

Expand Down Expand Up @@ -512,7 +511,9 @@ def write_tree(self):
:raise UnmergedEntriesError: """
# we obtain no lock as we just flush our contents to disk as tree
# If we are a new index, the entries access will load our data accordingly
mdb = PureMemoryDB()
# Needs delayed import as db.py import IndexFile as well
import git.db.py.mem
mdb = git.db.py.mem.PureMemoryDB()
entries = self._entries_sorted()
binsha, tree_items = write_tree_from_cache(entries, mdb, slice(0, len(entries)))

Expand Down
2 changes: 1 addition & 1 deletion git/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
"""This module is just to maintain compatibility to git-python 0.3x"""

from git.db.cmd import CmdCompatibilityGitDB
from git.db.cmd.complex import CmdCompatibilityGitDB


import warnings
Expand Down
26 changes: 17 additions & 9 deletions git/test/test_repo.py → git/test/db/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from git.test.lib import TestBase
from lib import TestDBBase
from git.test.lib import *
from git import *
from git.util import join_path_native
from git.exc import BadObject
Expand All @@ -15,18 +16,22 @@
from cStringIO import StringIO


class TestRepo(TestBase):
class RepoGlobalsItemDeletorMetaCls(GlobalsItemDeletorMetaCls):
ModuleToDelete = 'RepoBase'


class RepoBase(TestDBBase):
"""Basic test for everything a fully implemented repository should support"""
__metaclass__ = RepoGlobalsItemDeletorMetaCls

@raises(InvalidGitRepositoryError)
def test_new_should_raise_on_invalid_repo_location(self):
Repo(tempfile.gettempdir())
self.failUnlessRaises(InvalidGitRepositoryError, self.RepoCls, tempfile.gettempdir())

@raises(NoSuchPathError)
def test_new_should_raise_on_non_existant_path(self):
Repo("repos/foobar")
self.failUnlessRaises(NoSuchPathError, self.RepoCls, "repos/foobar")

def test_repo_creation_from_different_paths(self):
r_from_gitdir = Repo(self.rorepo.git_dir)
r_from_gitdir = self.RepoCls(self.rorepo.git_dir)
assert r_from_gitdir.git_dir == self.rorepo.git_dir
assert r_from_gitdir.git_dir.endswith('.git')
assert not self.rorepo.git.working_dir.endswith('.git')
Expand Down Expand Up @@ -184,7 +189,10 @@ def test_init(self):
# END restore previous state

def test_bare_property(self):
self.rorepo.bare
if isinstance(self.rorepo, RepoCompatibilityInterface):
self.rorepo.bare
#END handle compatability
self.rorepo.is_bare

def test_daemon_export(self):
orig_val = self.rorepo.daemon_export
Expand All @@ -204,7 +212,7 @@ def test_alternates(self):
self.rorepo.alternates = cur_alternates

def test_repr(self):
path = os.path.join(os.path.abspath(GIT_REPO), '.git')
path = os.path.join(os.path.abspath(rorepo_dir()), '.git')
assert_equal('<git.Repo "%s">' % path, repr(self.rorepo))

def test_is_dirty_with_bare_repository(self):
Expand Down
4 changes: 4 additions & 0 deletions git/test/db/cmd/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2010, 2011 Sebastian Thiel ([email protected]) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
13 changes: 13 additions & 0 deletions git/test/db/cmd/test_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (C) 2010, 2011 Sebastian Thiel ([email protected]) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
from git.test.lib import *
from git.db import RefSpec

class TestBase(TestDBBase):

@with_rw_directory
def test_basics(self, path):
assert False

7 changes: 0 additions & 7 deletions git/test/db/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
)

from git.stream import Sha1Writer

# import database types we want to support
# they will be set to None if the respective library could not be loaded
from git.db.py import PureGitDB

from git.base import (
IStream,
OStream,
Expand All @@ -40,8 +35,6 @@ class TestDBBase(TestBase):
two_lines = "1234\nhello world"
all_data = (two_lines, )

# all supported database types. Add your own type
ref_db_types = (PureGitDB, )

def _assert_object_writing_simple(self, db):
# write a bunch of objects and query their streams and info
Expand Down
4 changes: 4 additions & 0 deletions git/test/db/py/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2010, 2011 Sebastian Thiel ([email protected]) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
18 changes: 18 additions & 0 deletions git/test/db/py/test_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (C) 2010, 2011 Sebastian Thiel ([email protected]) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
from git.test.lib import *
from git.test.db.base import RepoBase
from git.db.py.complex import *

from git.db.complex import PureCmdGitDB

class TestPyDBBase(RepoBase):

RepoCls = PureCmdGitDB

def test_instantiation(self):
db = PureGitDB(rorepo_dir())
cdb = PureCompatibilityGitDB(rorepo_dir())

20 changes: 5 additions & 15 deletions git/test/lib/base.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Copyright (C) 2010, 2011 Sebastian Thiel ([email protected]) and contributors
#
# This module is part of PureGitDB and is released under
# This module is part of PureCmdGitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
"""Utilities used in ODB testing"""
from git.base import OStream
from git.db.py import PureGitDB
from git.stream import (
Sha1Writer,
ZippedStoreShaWriter
Expand Down Expand Up @@ -73,7 +72,7 @@ def wrapper(self, path):
shutil.copytree(src_dir, path)
target_gitdir = os.path.join(path, '.git')
assert os.path.isdir(target_gitdir)
return func(self, PureGitDB(target_gitdir))
return func(self, self.RepoCls(target_gitdir))
#END wrapper
wrapper.__name__ = func.__name__
return with_rw_directory(wrapper)
Expand All @@ -98,17 +97,17 @@ def wrapper(self, path):

#{ Routines

def repo_dir():
def rorepo_dir():
""":return: path to our own repository, being our own .git directory.
:note: doesn't work in bare repositories"""
base = os.path.join(dirname(dirname(dirname(dirname(__file__)))), '.git')
assert os.path.isdir(base)
return base


def maketemp(*args):
def maketemp(*args, **kwargs):
"""Wrapper around default tempfile.mktemp to fix an osx issue"""
tdir = tempfile.mktemp(*args)
tdir = tempfile.mktemp(*args, **kwargs)
if sys.platform == 'darwin':
tdir = '/private' + tdir
return tdir
Expand Down Expand Up @@ -192,12 +191,3 @@ def _assert(self):

#} END stream utilitiess

#{ Bases

class TestBase(unittest.TestCase):
"""Base class for all tests"""
# The non-database specific tests just provides a default pure git database
rorepo = PureGitDB(repo_dir())

#} END bases

Loading