HMBXR5601-395 sanitise the commit comment for control characters
This commit is contained in:
parent
dc07a8b3fc
commit
9acab85d20
1 changed files with 2 additions and 1 deletions
|
|
@ -205,7 +205,8 @@ def gitAddCommitTagAll(versionNumber):
|
|||
# Git commit
|
||||
commitComment = versionNumber
|
||||
if "COMMIT_COMMENT" in os.environ :
|
||||
commitComment = commitComment + ' :: ' + os.environ["COMMIT_COMMENT"]
|
||||
import unicodedata
|
||||
commitComment = commitComment + ' :: ' + "".join(ch for ch in os.environ["COMMIT_COMMENT"] if unicodedata.category(ch)[0]!="C") # Cleans up non printable characters
|
||||
print("git committing local repo: ", localRepoPath, " Comment: ", commitComment)
|
||||
spout = subprocess.check_output([gitExecutable, "commit", "-a", "-m", commitComment], stderr = subprocess.STDOUT)
|
||||
print("Result: ", spout.decode('utf-8'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue