mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
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>
This commit is contained in:
parent
521cd3ce67
commit
1775dbe176
@ -82,16 +82,21 @@ not redirected.
|
|||||||
rc = 0
|
rc = 0
|
||||||
for project in self.GetProjects(args):
|
for project in self.GetProjects(args):
|
||||||
env = dict(os.environ.iteritems())
|
env = dict(os.environ.iteritems())
|
||||||
env['REPO_PROJECT'] = project.name
|
def setenv(name, val):
|
||||||
env['REPO_PATH'] = project.relpath
|
if val is None:
|
||||||
env['REPO_REMOTE'] = project.remote.name
|
val = ''
|
||||||
env['REPO_LREV'] = project\
|
env[name] = val
|
||||||
|
|
||||||
|
setenv('REPO_PROJECT', project.name)
|
||||||
|
setenv('REPO_PATH', project.relpath)
|
||||||
|
setenv('REPO_REMOTE', project.remote.name)
|
||||||
|
setenv('REPO_LREV', project\
|
||||||
.GetRemote(project.remote.name)\
|
.GetRemote(project.remote.name)\
|
||||||
.ToLocal(project.revision)
|
.ToLocal(project.revision))
|
||||||
env['REPO_RREV'] = project.revision
|
setenv('REPO_RREV', project.revision)
|
||||||
|
|
||||||
if mirror:
|
if mirror:
|
||||||
env['GIT_DIR'] = project.gitdir
|
setenv('GIT_DIR', project.gitdir)
|
||||||
cwd = project.gitdir
|
cwd = project.gitdir
|
||||||
else:
|
else:
|
||||||
cwd = project.worktree
|
cwd = project.worktree
|
||||||
|
Loading…
Reference in New Issue
Block a user