From ee38137aac4072fdd4d939ed52c49920802fe699 Mon Sep 17 00:00:00 2001 From: Tim Head Date: Thu, 7 Nov 2019 23:15:29 +0100 Subject: [PATCH] Remove explicit checkout when ref given --- repo2docker/contentproviders/git.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/repo2docker/contentproviders/git.py b/repo2docker/contentproviders/git.py index 35f7b990..e203fa6b 100644 --- a/repo2docker/contentproviders/git.py +++ b/repo2docker/contentproviders/git.py @@ -48,12 +48,9 @@ class Git(ContentProvider): "Failed to check out ref %s", ref, extra=dict(phase="failed") ) raise ValueError("Failed to check out ref {}".format(ref)) - # check out ref as it has not been done yet - for line in execute_cmd( - ["git", "checkout", hash], cwd=output_dir, capture=yield_output - ): - yield line - # If the hash is resolved above, we should be able to reset to it + # We don't need to explicitly checkout things as the reset will + # take of that. If the hash is resolved above, we should be + # able to reset to it for line in execute_cmd( ["git", "reset", "--hard", hash], cwd=output_dir, capture=yield_output ):