Local repositories clone a blank repo

This commit is contained in:
Anthony Sottile 2017-02-15 12:47:13 -08:00
parent e704edb5e2
commit f000241dcb
15 changed files with 156 additions and 121 deletions

View file

@ -1,7 +1,6 @@
from __future__ import unicode_literals
import os.path
import shutil
import jsonschema
import pytest
@ -20,24 +19,6 @@ def get_resource_path(path):
return os.path.join(TESTING_DIR, 'resources', path)
def copy_tree_to_path(src_dir, dest_dir):
"""Copies all of the things inside src_dir to an already existing dest_dir.
This looks eerily similar to shutil.copytree, but copytree has no option
for not creating dest_dir.
"""
names = os.listdir(src_dir)
for name in names:
srcname = os.path.join(src_dir, name)
destname = os.path.join(dest_dir, name)
if os.path.isdir(srcname):
shutil.copytree(srcname, destname)
else:
shutil.copy(srcname, destname)
def get_head_sha(dir):
with cwd(dir):
return cmd_output('git', 'rev-parse', 'HEAD')[1].strip()