Exit when loop-claude is started outside a checkout
This commit is contained in:
@@ -86,10 +86,12 @@ 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):
|
||||
def test_is_the_checkout_from_any_directory_inside_it_and_exits_outside_one(self):
|
||||
with tempfile.TemporaryDirectory() as tmp, contextlib.chdir(tmp):
|
||||
root = os.getcwd()
|
||||
self.assertEqual(loop.checkout_root(), root)
|
||||
with self.assertRaises(SystemExit) as stopped:
|
||||
loop.checkout_root()
|
||||
self.assertIn("not a git repository", stopped.exception.code)
|
||||
subprocess.run(["git", "init", "-q"], check=True)
|
||||
os.makedirs("a/b")
|
||||
with contextlib.chdir("a/b"):
|
||||
|
||||
Reference in New Issue
Block a user