Permalink
Browse files

Merge #7425: devtools: Fix utf-8 support in messages for github-merge

c8a6c11 devtools: Fix utf-8 support in messages for github-merge (Wladimir J. van der Laan)
  • Loading branch information...
laanwj committed Jan 28, 2016
2 parents 4a46bdc + c8a6c11 commit 20a408ca99dad3cbb8c1cea0fe5c3d52f328061e
Showing with 3 additions and 3 deletions.
  1. +3 −3 contrib/devtools/github-merge.py
@@ -147,14 +147,14 @@ def main():
else:
firstline = 'Merge #%s' % (pull,)
message = firstline + '\n\n'
message += subprocess.check_output([GIT,'log','--no-merges','--topo-order','--pretty=format:%h %s (%an)',base_branch+'..'+head_branch])
message += subprocess.check_output([GIT,'log','--no-merges','--topo-order','--pretty=format:%h %s (%an)',base_branch+'..'+head_branch]).decode('utf-8')
try:
subprocess.check_call([GIT,'merge','-q','--commit','--no-edit','--no-ff','-m',message,head_branch])
subprocess.check_call([GIT,'merge','-q','--commit','--no-edit','--no-ff','-m',message.encode('utf-8'),head_branch])
except subprocess.CalledProcessError as e:
print("ERROR: Cannot be merged cleanly.",file=stderr)
subprocess.check_call([GIT,'merge','--abort'])
exit(4)
logmsg = subprocess.check_output([GIT,'log','--pretty=format:%s','-n','1'])
logmsg = subprocess.check_output([GIT,'log','--pretty=format:%s','-n','1']).decode('utf-8')
if logmsg.rstrip() != firstline.rstrip():
print("ERROR: Creating merge failed (already merged?).",file=stderr)
exit(4)

0 comments on commit 20a408c

Please sign in to comment.