diff --git a/helpers/GitHelper.py b/helpers/GitHelper.py index 9b30b59..5fbcd6e 100644 --- a/helpers/GitHelper.py +++ b/helpers/GitHelper.py @@ -3,6 +3,7 @@ from git import Repo + class GitHelper(object): """ Helper class for GIT @@ -43,9 +44,11 @@ def push_changes_in_pull_request(self, repository, message, target_branch, head_ r.git.execute(['git', 'checkout', '-b', target_branch]) files_to_add = r.git.execute( ['git', 'ls-files', '--others', '--exclude-standard', 'grep', '\\.java', '|', 'grep', 'src/test']) - r.git.execute(['git', 'add', files_to_add]) + files_to_add = files_to_add.split("\n") + for file in files_to_add: + r.git.execute(['git', 'add', file]) r.git.commit('-am', message) origin = r.remote(name='origin') origin.push(target_branch) - self.create_pull_request(repository, message, '', target_branch, head_branch, token) \ No newline at end of file + self.create_pull_request(repository, message, '', target_branch, head_branch, token)