|
@@ -35,6 +35,7 @@ from dulwich.object_store import (
|
|
|
)
|
|
|
from dulwich import objects
|
|
|
from dulwich.config import Config
|
|
|
+from dulwich.errors import NotGitRepository
|
|
|
from dulwich.repo import (
|
|
|
Repo,
|
|
|
MemoryRepo,
|
|
@@ -766,7 +767,14 @@ class BuildRepoRootTests(TestCase):
|
|
|
self.assertEqual(stat.S_IFREG | 0o644, mode)
|
|
|
self.assertEqual(encoding.encode('ascii'), r[id].data)
|
|
|
|
|
|
- def test_discover(self):
|
|
|
+ def test_discover_intended(self):
|
|
|
path = os.path.join(self._repo_dir, 'b/c')
|
|
|
r = Repo.discover(path)
|
|
|
self.assertEqual(r.head(), self._repo.head())
|
|
|
+
|
|
|
+ def test_discover_isrepo(self):
|
|
|
+ r = Repo.discover(self._repo_dir)
|
|
|
+ self.assertEqual(r.head(), self._repo.head())
|
|
|
+
|
|
|
+ def test_discover_notrepo(self):
|
|
|
+ self.assertRaises(NotGitRepository, Repo.discover('/'))
|