From a66b90722c0924f1bba120d268c8a1afa3a89868 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karl=20Hasselstr=C3=B6m?= Date: Fri, 17 Apr 2009 03:02:11 +0200 Subject: [PATCH] Newer gits return 128 when git config --{rename,remove}-section fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit As of commit d64ec16c ("git config: reorganize to use parseopt"), git config --rename-section and --remove-section will now call die() instead of exit(1) when the section to be renamed or removed doesn't exist, and die() calls exit(128). So we have to catch exit code 128 as well. Signed-off-by: Karl Hasselström --- stgit/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stgit/config.py b/stgit/config.py index efce097..dbca5fb 100644 --- a/stgit/config.py +++ b/stgit/config.py @@ -73,14 +73,14 @@ class GitConfig: """Rename a section in the config file. Silently do nothing if the section doesn't exist.""" Run('git', 'config', '--rename-section', from_name, to_name - ).returns([0, 1]).run() + ).returns([0, 1, 128]).run() self.__cache.clear() def remove_section(self, name): """Remove a section in the config file. Silently do nothing if the section doesn't exist.""" Run('git', 'config', '--remove-section', name - ).returns([0, 1]).discard_stderr().discard_output() + ).returns([0, 1, 128]).discard_stderr().discard_output() self.__cache.clear() def set(self, name, value): -- 2.11.0