Documentation says “An existing file was copied to create a new file.”
But we have yet to see a COPY when adding a new file that has same content of an existing file.
We do see a COPY occur when both a rename and an add of two files with the same content occur in the same commit.
However Bitbucket does not necessarily mark the mv as a MOVE and the add as a COPY. It appears to use the “first” file with identical content as the COPY (COPIED when viewing the diff) and the “next” file as the MOVE (RENAMED when viewing the diff).
Consider the following where file_A and file_B have identical content:
- git mv file_A file_X
- cp file_B file_C; git add file_C
- git mv file_B file_Y
- git commit -a; git push origin
git show --oneline --name-status
5ff6f10 (HEAD → work_branch, origin/work_branch) JIRA-123 all the same content
R100 file_A file_X
R100 file_B file_Y
A file_C
Bitbucket commit 5ff6f10 (as well as commitService.getChanges)
file_X - COPIED # change.srcPath = file_A ← this was expected to be a RENAME
file_Y - RENAMED # change.srcPath = file_B
file_C - RENAMED # change.srcPath = file_A ← this was expected to be an ADD w/ null src