forked from indymedia/epicyon
Don't convert post if it doesn't contain a commit hash
parent
e1951b0bad
commit
802fa62e03
9
git.py
9
git.py
|
@ -116,15 +116,16 @@ def convertPostToCommit(baseDir: str, nickname: str, domain: str,
|
||||||
postJsonObject['object']['content'],
|
postJsonObject['object']['content'],
|
||||||
False):
|
False):
|
||||||
return False
|
return False
|
||||||
|
patchStr = gitFormatContent(postJsonObject['object']['content'])
|
||||||
|
commitHash = getGitHash(patchStr)
|
||||||
|
if not commitHash:
|
||||||
|
return False
|
||||||
postJsonObject['object']['type'] = 'Commit'
|
postJsonObject['object']['type'] = 'Commit'
|
||||||
# add a commitedBy parameter
|
# add a commitedBy parameter
|
||||||
if not postJsonObject['object'].get('committedBy'):
|
if not postJsonObject['object'].get('committedBy'):
|
||||||
postJsonObject['object']['committedBy'] = \
|
postJsonObject['object']['committedBy'] = \
|
||||||
postJsonObject['object']['attributedTo']
|
postJsonObject['object']['attributedTo']
|
||||||
patchStr = gitFormatContent(postJsonObject['object']['content'])
|
postJsonObject['object']['hash'] = commitHash
|
||||||
commitHash = getGitHash(patchStr)
|
|
||||||
if commitHash:
|
|
||||||
postJsonObject['object']['hash'] = commitHash
|
|
||||||
postJsonObject['object']['description'] = {
|
postJsonObject['object']['description'] = {
|
||||||
"mediaType": "text/plain",
|
"mediaType": "text/plain",
|
||||||
"content": patchStr
|
"content": patchStr
|
||||||
|
|
Loading…
Reference in New Issue