diff options
author | Shawn O. Pearce <sop@google.com> | 2009-03-17 08:03:04 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2009-03-17 08:03:04 -0700 |
commit | 1775dbe176fe284a9baa8697f600f03e9b8dabbc (patch) | |
tree | eaeef4183455a6c7d2324d86046368e952dda33e /subcmds | |
parent | 521cd3ce67a3621dbbad906f8402dbde8a1e9e63 (diff) | |
download | git-repo-1775dbe176fe284a9baa8697f600f03e9b8dabbc.tar.gz |
Set forall environment variables to empty string if None
If the value obtained is None we now set the variable to
'' instead, in an attempt to make execve() happier about
our 3rd argument, the env dictionary.
Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/forall.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/subcmds/forall.py b/subcmds/forall.py index bc0d455d..6dff252d 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py | |||
@@ -82,16 +82,21 @@ not redirected. | |||
82 | rc = 0 | 82 | rc = 0 |
83 | for project in self.GetProjects(args): | 83 | for project in self.GetProjects(args): |
84 | env = dict(os.environ.iteritems()) | 84 | env = dict(os.environ.iteritems()) |
85 | env['REPO_PROJECT'] = project.name | 85 | def setenv(name, val): |
86 | env['REPO_PATH'] = project.relpath | 86 | if val is None: |
87 | env['REPO_REMOTE'] = project.remote.name | 87 | val = '' |
88 | env['REPO_LREV'] = project\ | 88 | env[name] = val |
89 | |||
90 | setenv('REPO_PROJECT', project.name) | ||
91 | setenv('REPO_PATH', project.relpath) | ||
92 | setenv('REPO_REMOTE', project.remote.name) | ||
93 | setenv('REPO_LREV', project\ | ||
89 | .GetRemote(project.remote.name)\ | 94 | .GetRemote(project.remote.name)\ |
90 | .ToLocal(project.revision) | 95 | .ToLocal(project.revision)) |
91 | env['REPO_RREV'] = project.revision | 96 | setenv('REPO_RREV', project.revision) |
92 | 97 | ||
93 | if mirror: | 98 | if mirror: |
94 | env['GIT_DIR'] = project.gitdir | 99 | setenv('GIT_DIR', project.gitdir) |
95 | cwd = project.gitdir | 100 | cwd = project.gitdir |
96 | else: | 101 | else: |
97 | cwd = project.worktree | 102 | cwd = project.worktree |