From cad9deb7d0785e062ec481acee2d9f1de46b4c6d Mon Sep 17 00:00:00 2001 From: Yuvi Panda Date: Wed, 1 Nov 2017 16:23:29 -0700 Subject: [PATCH] Revert "Add handling for no ref being provided" --- repo2docker/app.py | 11 ++++------- tests/conftest.py | 11 ++++++----- tests/external/shallow-clone.repos.yaml | 6 ------ 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/repo2docker/app.py b/repo2docker/app.py index 844a7d67..a985fa38 100644 --- a/repo2docker/app.py +++ b/repo2docker/app.py @@ -144,13 +144,10 @@ class Repo2Docker(Application): # create a shallow clone first _clone(depth=50) - # ref == None means we want to use HEAD so no need to checkout a - # specific revision - if ref is not None: - if not _contains(ref): - # have to create a full clone - _unshallow() - _checkout(ref) + if not _contains(ref): + # have to create a full clone + _unshallow() + _checkout(ref) def get_argparser(self): argparser = argparse.ArgumentParser() diff --git a/tests/conftest.py b/tests/conftest.py index 452ec2ac..2d1e7acc 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -51,8 +51,9 @@ class RemoteRepoTest(pytest.Item): self.verify = verify def runtest(self): - if self.ref is not None: - cmd = ['jupyter-repo2docker', '--ref', self.ref, self.url, '--'] - else: - cmd = ['jupyter-repo2docker', self.url, '--'] - subprocess.check_call(cmd + shlex.split(self.verify)) + subprocess.check_call([ + 'jupyter-repo2docker', + '--ref', self.ref, + self.url, + '--', + ] + shlex.split(self.verify)) diff --git a/tests/external/shallow-clone.repos.yaml b/tests/external/shallow-clone.repos.yaml index eb3fc5cc..cdeccf9c 100644 --- a/tests/external/shallow-clone.repos.yaml +++ b/tests/external/shallow-clone.repos.yaml @@ -11,9 +11,3 @@ # we checkout the second to last commit, hence the log has 49 entries at a # max clone depth of 50 verify: /bin/bash -c '[ $(git log --oneline | wc -l) == "49" ]' - -- name: A dummy repo with 100 commits - live at HEAD - url: https://github.com/betatim/repo2docker-ci-clone-depth - # provide no ref, aka use HEAD, aka the 100th commit - ref: NULL - verify: python -c "commit = open('COMMIT').read(); assert int(commit) == 100, 'this is not the 100th commit'"