Commit a968e4bb authored by Ayush Tiwari's avatar Ayush Tiwari

Remove all use of shell in subprocess

parent 639449fb
......@@ -62,8 +62,8 @@ class GitCloneNonInformativeTests(unittest.TestCase):
# Add submodule to main repo
submodule_dir_main_repo = os.path.join(self.project_dir, 'dir1')
check_call('git submodule add %s' % self.submodule_dir,
cwd=submodule_dir_main_repo, shell=True)
check_call(['git', 'submodule', 'add', self.submodule_dir],
cwd=submodule_dir_main_repo)
self.gitCommit(self.project_dir, msg='Add submodule repo')
def tearDown(self):
......@@ -84,8 +84,8 @@ class GitCloneNonInformativeTests(unittest.TestCase):
"""
Setup user and email for given git repository
"""
check_call("git config user.email 'test@example.com'", cwd=proj_dir, shell=True)
check_call("git config user.name 'Test'", cwd=proj_dir, shell=True)
check_call(['git', 'config', 'user.email', 'test@example.com'], cwd=proj_dir)
check_call(['git', 'config', 'user.name', 'Test'], cwd=proj_dir)
def gitAdd(self, proj_dir, update=False):
"""runs a 'git add .' in the provided git repo
......@@ -103,9 +103,7 @@ class GitCloneNonInformativeTests(unittest.TestCase):
:param proj_dir: path to a git repo
"""
try:
check_call('git commit -m "%s"' % msg,
cwd=proj_dir,
shell=True)
check_call(['git', 'commit', '-m', msg], cwd=proj_dir)
except CalledProcessError as e:
logging.error("'git commit' failed with '%s'" % e.returncode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment