From c6fc5dc1e9f33a601759395eb493c47be9bf5a74 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Tue, 15 Jun 2010 16:08:29 +0200 Subject: [PATCH] ignore errors on git commit (not git push) --- module-tools.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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): -- 2.47.0