Merge #9905: [contrib] gh-merge: Move second sha512 check to the end
fa7da3f
[contrib] gh-merge: Move second sha512 check to before signing (MarcoFalke)
Tree-SHA512: b3d96f928a013f6fdc416035b8ef5cd7c750ab0922156e1fd712cd27ec75847497109f43a96559b945ba11ad43b5644ed9c1de695590ff608658628fb57b1571
This commit is contained in:
commit
01b7cda916
1 changed files with 5 additions and 4 deletions
|
@ -212,10 +212,6 @@ def main():
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
printf("ERROR: Cannot update message.",file=stderr)
|
printf("ERROR: Cannot update message.",file=stderr)
|
||||||
exit(4)
|
exit(4)
|
||||||
second_sha512 = tree_sha512sum()
|
|
||||||
if first_sha512 != second_sha512:
|
|
||||||
print("ERROR: Tree hash changed unexpectedly",file=stderr)
|
|
||||||
exit(4)
|
|
||||||
|
|
||||||
print('%s#%s%s %s %sinto %s%s' % (ATTR_RESET+ATTR_PR,pull,ATTR_RESET,title,ATTR_RESET+ATTR_PR,branch,ATTR_RESET))
|
print('%s#%s%s %s %sinto %s%s' % (ATTR_RESET+ATTR_PR,pull,ATTR_RESET,title,ATTR_RESET+ATTR_PR,branch,ATTR_RESET))
|
||||||
subprocess.check_call([GIT,'log','--graph','--topo-order','--pretty=format:'+COMMIT_FORMAT,base_branch+'..'+head_branch])
|
subprocess.check_call([GIT,'log','--graph','--topo-order','--pretty=format:'+COMMIT_FORMAT,base_branch+'..'+head_branch])
|
||||||
|
@ -258,6 +254,11 @@ def main():
|
||||||
print("ERROR: Merge rejected.",file=stderr)
|
print("ERROR: Merge rejected.",file=stderr)
|
||||||
exit(7)
|
exit(7)
|
||||||
|
|
||||||
|
second_sha512 = tree_sha512sum()
|
||||||
|
if first_sha512 != second_sha512:
|
||||||
|
print("ERROR: Tree hash changed unexpectedly",file=stderr)
|
||||||
|
exit(8)
|
||||||
|
|
||||||
# Sign the merge commit.
|
# Sign the merge commit.
|
||||||
reply = ask_prompt("Type 's' to sign off on the merge.")
|
reply = ask_prompt("Type 's' to sign off on the merge.")
|
||||||
if reply == 's':
|
if reply == 's':
|
||||||
|
|
Loading…
Reference in a new issue