From: Barış Metin Date: Tue, 15 Jun 2010 14:08:29 +0000 (+0200) Subject: ignore errors on git commit (not git push) X-Git-Tag: 5.0-rc11~51 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c6fc5dc1e9f33a601759395eb493c47be9bf5a74;p=build.git ignore errors on git commit (not git push) --- diff --git a/module-tools.py b/module-tools.py index a6605d2d..e833cd99 100755 --- a/module-tools.py +++ b/module-tools.py @@ -276,9 +276,12 @@ class GitRepository: os.chdir(cwd) return ret - def __run_command_in_repo(self, command): + def __run_command_in_repo(self, command, ignore_errors=False): c = Command(command, self.options) - return self.__run_in_repo(c.run_fatal) + if ignore_errors: + return self.__run_in_repo(c.output_of) + else: + return self.__run_in_repo(c.run_fatal) def update(self, subdir=None, recursive=None): return self.__run_command_in_repo("git pull") @@ -304,8 +307,8 @@ class GitRepository: return self.__run_in_repo(c.output_of, with_stderr=True) def commit(self, logfile): - self.__run_command_in_repo("git add -A") - self.__run_command_in_repo("git commit -F %s" % logfile) + self.__run_command_in_repo("git add -A", ignore_errors=True) + self.__run_command_in_repo("git commit -F %s" % logfile, ignore_errors=True) self.__run_command_in_repo("git push --tags") def revert(self):