def test_git_add_and_commit_everything_with_dotgit(self, tmpdir): """Test Git.add_and_commit_everything().""" tmpdir = Path(str(tmpdir)) # if there's a .git file somewhere in the archive, we don't want it to fail adding subprocess.check_output(['git', 'init', str(tmpdir)], universal_newlines=True) d = tmpdir / 'foo' d.mkdir(parents=True) (d / '.git').touch() # we need at least one normal file for git to commit (d / 'foo').touch() g = Git.create_git(str(tmpdir)) g.add_and_commit_everything()
def test_git_add_and_commit_everything_with_dotgit(self, tmpdir): # if there's a .git file somewhere in the archive, we don't want it to fail adding subprocess.check_output(['git', 'init', str(tmpdir)], universal_newlines=True) d = os.path.join(str(tmpdir), 'foo') os.makedirs(d) with open(os.path.join(d, '.git'), 'w') as f: f.write('gitdir: /this/doesnt/exist/hehehe') # we need at least one normal file for git to commit with open(os.path.join(d, 'foo'), 'w'): pass g = Git.create_git(str(tmpdir)) g.add_and_commit_everything()