Skip to content

CodeDiffFile

One changed file in a diff.

Kind: an object, used in responses.

Every field is present in a response; empty ones are null.

FieldTypeDescription
fileModeOldstring | nullThe file’s old mode (for example 100644), when it was deleted or its mode changed.
fileModeNewstring | nullThe file’s new mode (for example 100755), when it is new or its mode changed.
pathOldstring | nullThe path the file was renamed or copied from.
pathNewstring | nullThe path the file was renamed or copied to.
isRenamedbooleanWhether the file was renamed.
isDeletedbooleanWhether the file was deleted.
isNewbooleanWhether the file is new.
isCopiedbooleanWhether the file was copied from another.
similarityIndexnumber | nullFor a rename or copy, how similar the two files are, as a percentage.
dissimilarityIndexnumber | nullFor a rewritten file, how different the old and new contents are, as a percentage.
hashOldstring | nullThe git object id (abbreviated) of the file’s old contents.
hashNewstring | nullThe git object id (abbreviated) of the file’s new contents.
filenamestring | nullThe file’s path within its repository.
changesCodeDiffChange[]The changed sections of the file. Empty for a binary file.
isBinarybooleanWhether the file is binary, so no line changes are given.
repositoryNamestring | nullThe name of the run repository the file is in.
{
"fileModeOld": "...",
"fileModeNew": "...",
"pathOld": "...",
"pathNew": "...",
"isRenamed": false,
"isDeleted": false,
"isNew": false,
"isCopied": false,
"similarityIndex": 0,
"dissimilarityIndex": 0,
"hashOld": "...",
"hashNew": "...",
"filename": "...",
"changes": [
{
"diff": [],
"header": "..."
}
],
"isBinary": false,
"repositoryName": "..."
}