Compare the checkout root to the resolved temp dir

This commit is contained in:
2026-09-25 08:44:37 +02:00
parent 13f0aae899
commit 76d1b218bf
+3 -2
View File
@@ -87,8 +87,9 @@ class HumanTurns(unittest.TestCase):
class CheckoutRoot(unittest.TestCase):
def test_is_the_checkout_from_any_directory_inside_it_and_the_directory_itself_outside_one(self):
with tempfile.TemporaryDirectory() as root, contextlib.chdir(root):
self.assertEqual(loop.checkout_root(), os.getcwd())
with tempfile.TemporaryDirectory() as tmp, contextlib.chdir(tmp):
root = os.getcwd()
self.assertEqual(loop.checkout_root(), root)
subprocess.run(["git", "init", "-q"], check=True)
os.makedirs("a/b")
with contextlib.chdir("a/b"):