diff options
-rw-r--r-- | morphlib/cachedrepo.py | 8 | ||||
-rw-r--r-- | morphlib/cachedrepo_tests.py | 5 |
2 files changed, 2 insertions, 11 deletions
diff --git a/morphlib/cachedrepo.py b/morphlib/cachedrepo.py index 5dc7e55d..0f348196 100644 --- a/morphlib/cachedrepo.py +++ b/morphlib/cachedrepo.py @@ -135,10 +135,9 @@ class CachedRepo(object): (filename, ref, self)) def checkout(self, ref, target_dir): - '''Unpacks the repository in a directory and checks out a SHA1 ref. + '''Unpacks the repository in a directory and checks out a commit ref. - Raises an UnresolvedNamedReferenceError if the specified ref is not - a SHA1 ref. Raises a CheckoutDirectoryExistsError if the target + Raises a CheckoutDirectoryExistsError if the target directory already exists. Raises an InvalidReferenceError if the ref is not found in the repository. Raises a CheckoutError if something else goes wrong while copying the repository or checking @@ -146,9 +145,6 @@ class CachedRepo(object): ''' - if not self.is_valid_sha1(ref): - raise UnresolvedNamedReferenceError(self, ref) - if os.path.exists(target_dir): raise CheckoutDirectoryExistsError(self, target_dir) diff --git a/morphlib/cachedrepo_tests.py b/morphlib/cachedrepo_tests.py index 72624f36..127a866b 100644 --- a/morphlib/cachedrepo_tests.py +++ b/morphlib/cachedrepo_tests.py @@ -152,11 +152,6 @@ class CachedRepoTests(unittest.TestCase): 'e28a23812eadf2fce6583b8819b9c5dbd36b9fb9', self.tempdir.dirname) - def test_fail_checkout_from_named_ref_which_is_not_allowed(self): - self.assertRaises(cachedrepo.UnresolvedNamedReferenceError, - self.repo.checkout, 'master', - self.tempdir.join('checkout-from-named-ref')) - def test_fail_checkout_from_invalid_ref(self): self.assertRaises(cachedrepo.InvalidReferenceError, self.repo.checkout, '079bbfd447c8534e464ce5d40b80114c2022ebf4', |