summaryrefslogtreecommitdiff
path: root/morphlib/gitdir_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/gitdir_tests.py')
-rw-r--r--morphlib/gitdir_tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/morphlib/gitdir_tests.py b/morphlib/gitdir_tests.py
index 456e3716..42118fe2 100644
--- a/morphlib/gitdir_tests.py
+++ b/morphlib/gitdir_tests.py
@@ -43,6 +43,16 @@ class GitDirectoryTests(unittest.TestCase):
gitdir = morphlib.gitdir.GitDirectory(self.dirname)
self.assertEqual(gitdir.dirname, self.dirname)
+ def test_can_search_for_top_directory(self):
+ self.fake_git_clone()
+
+ path_inside_working_tree = os.path.join(self.dirname, 'a', 'b', 'c')
+ os.makedirs(path_inside_working_tree)
+
+ gitdir = morphlib.gitdir.GitDirectory(
+ path_inside_working_tree, search_for_root=True)
+ self.assertEqual(gitdir.dirname, self.dirname)
+
def test_runs_command_in_right_directory(self):
self.fake_git_clone()
gitdir = morphlib.gitdir.GitDirectory(self.dirname)