diff options
author | Shawn O. Pearce <sop@google.com> | 2010-12-07 11:41:05 -0800 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2011-01-09 16:13:56 -0800 |
commit | f18cb761731a791bf1b9ee8c6308bfce5c9d3e62 (patch) | |
tree | 5b1440e04b3945177eb7033f40cf496e7e28ba34 /subcmds/sync.py | |
parent | d3fd537ea59272e2141ccee839400a93c0196e36 (diff) | |
download | git-repo-f18cb761731a791bf1b9ee8c6308bfce5c9d3e62.tar.gz |
Encode the environment variables passed to git
Windows allows the environment to have unicode values.
This will cause Python to fail to execute the command.
Change-Id: I37d922c3d7ced0d5b4883f0220346ac42defc5e9
Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index d6ea442a..80bba1aa 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -269,7 +269,7 @@ uncommitted changes are present' % project.relpath | |||
269 | if branch.startswith(R_HEADS): | 269 | if branch.startswith(R_HEADS): |
270 | branch = branch[len(R_HEADS):] | 270 | branch = branch[len(R_HEADS):] |
271 | 271 | ||
272 | env = dict(os.environ) | 272 | env = os.environ.copy() |
273 | if (env.has_key('TARGET_PRODUCT') and | 273 | if (env.has_key('TARGET_PRODUCT') and |
274 | env.has_key('TARGET_BUILD_VARIANT')): | 274 | env.has_key('TARGET_BUILD_VARIANT')): |
275 | target = '%s-%s' % (env['TARGET_PRODUCT'], | 275 | target = '%s-%s' % (env['TARGET_PRODUCT'], |
@@ -413,9 +413,9 @@ warning: Cannot automatically authenticate repo.""" | |||
413 | % (project.name, rev) | 413 | % (project.name, rev) |
414 | return False | 414 | return False |
415 | 415 | ||
416 | env = dict(os.environ) | 416 | env = os.environ.copy() |
417 | env['GIT_DIR'] = project.gitdir | 417 | env['GIT_DIR'] = project.gitdir.encode() |
418 | env['GNUPGHOME'] = gpg_dir | 418 | env['GNUPGHOME'] = gpg_dir.encode() |
419 | 419 | ||
420 | cmd = [GIT, 'tag', '-v', cur] | 420 | cmd = [GIT, 'tag', '-v', cur] |
421 | proc = subprocess.Popen(cmd, | 421 | proc = subprocess.Popen(cmd, |