fix(backend-gitlab): use move commit action only if paths are different (#4064)

This commit is contained in:
Erez Rokah 2020-07-23 16:32:03 +02:00 committed by GitHub
parent 8df4926897
commit 0d1a3bb9f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -478,8 +478,9 @@ export default class API {
let path = trimStart(file.path, '/');
let oldPath = undefined;
if (fileExists) {
action = file.newPath ? CommitAction.MOVE : CommitAction.UPDATE;
oldPath = file.newPath && path;
action =
file.newPath && file.newPath !== oldPath ? CommitAction.MOVE : CommitAction.UPDATE;
path = file.newPath ? trimStart(file.newPath, '/') : path;
}