[meld] bin/meld: Don't pass git environment vars on to children (bgo#741142)
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] bin/meld: Don't pass git environment vars on to children (bgo#741142)
- Date: Fri, 12 Dec 2014 20:31:29 +0000 (UTC)
commit f3002310da1c5db3bfe0f093c898815d712f39a9
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Dec 13 06:21:43 2014 +1000
bin/meld: Don't pass git environment vars on to children (bgo#741142)
GIT_DIR and GIT_WORK_TREE are somewhat-helpfully set by some helper
tools such as git-gui. However, since we are quite good about setting
the cwd everywhere we call our git helpers, this sometimes messes with
things for us when invoking from subdirectories and whatnot. Since
these vars aren't helping us anyway, we'll just unset them in Meld's
environment altogether.
bin/meld | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/bin/meld b/bin/meld
index 0be179d..060b15e 100755
--- a/bin/meld
+++ b/bin/meld
@@ -252,12 +252,23 @@ def setup_logging():
log.addHandler(handler)
+def environment_hacks():
+ # We manage cwd ourselves for git operations, and GIT_DIR in particular
+ # can mess with this when set.
+ for var in ('GIT_DIR', 'GIT_WORK_TREE'):
+ try:
+ del os.environ[var]
+ except KeyError:
+ pass
+
+
if __name__ == '__main__':
setup_logging()
disable_stdout_buffering()
check_requirements()
setup_settings()
setup_resources()
+ environment_hacks()
import meld.meldapp
if sys.platform != 'win32':
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]