def add_commit_in_branch(self, clone_dir, branch, files=None, commit=None):
        self.exe('git checkout master', clone_dir)
        self.exe('git checkout -b %s' % branch, clone_dir)
        if not files:
            file(os.path.join(clone_dir, 'testfile'), 'w').write('data')
            files = ['testfile']
        self.git_add(clone_dir, files)
        if not commit:
            commit = "Adding testfile"
        self.exe("git commit --author '%s' -m '%s'" % (self.author, commit),
                 clone_dir)
dataset/ETHPy150Open redhat-cip/software-factory/tests/functional/utils.py/GerritGitUtils.add_commit_in_branch/original