mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
git-number cannot commit-tree without user config
user.name and/or user.email may be not configured, so specify them explictly for commit-tree. R=iannucci@chromium.org BUG=354276 Review URL: https://codereview.chromium.org/222103006 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@261256 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@@ -37,6 +37,8 @@ CHUNK_FMT = '!20sL'
|
||||
CHUNK_SIZE = struct.calcsize(CHUNK_FMT)
|
||||
DIRTY_TREES = collections.defaultdict(int)
|
||||
REF = 'refs/number/commits'
|
||||
AUTHOR_NAME = 'git-number'
|
||||
AUTHOR_EMAIL = 'chrome-infrastructure-team@google.com'
|
||||
|
||||
# Number of bytes to use for the prefix on our internal number structure.
|
||||
# 0 is slow to deserialize. 2 creates way too much bookeeping overhead (would
|
||||
@@ -153,7 +155,14 @@ def finalize(targets):
|
||||
assert updater.returncode == 0
|
||||
|
||||
tree_id = git.run('write-tree', env=env)
|
||||
commit_cmd = ['commit-tree', '-m', msg, '-p'] + git.hash_multi(REF)
|
||||
commit_cmd = [
|
||||
# Git user.name and/or user.email may not be configured, so specifying
|
||||
# them explicitly. They are not used, but requried by Git.
|
||||
'-c', 'user.name=%s' % AUTHOR_NAME,
|
||||
'-c', 'user.email=%s' % AUTHOR_EMAIL,
|
||||
'commit-tree',
|
||||
'-m', msg,
|
||||
'-p'] + git.hash_multi(REF)
|
||||
for t in targets:
|
||||
commit_cmd.extend(['-p', binascii.hexlify(t)])
|
||||
commit_cmd.append(tree_id)
|
||||
|
||||
Reference in New Issue
Block a user