From c7c971d5087f85001c095ab87652108666e6b532 Mon Sep 17 00:00:00 2001 From: shizhendong Date: Fri, 8 Nov 2024 15:27:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20application=20diff=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=8Caction=20=E6=94=AF=E6=8C=81=20rename?= =?UTF-8?q?,copy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ApplicationMergeServiceImpl.java | 8 ++++++-- .../app/service/impl/GitServiceImpl.java | 20 ++++++++++--------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/geedge/asw/module/app/service/impl/ApplicationMergeServiceImpl.java b/src/main/java/net/geedge/asw/module/app/service/impl/ApplicationMergeServiceImpl.java index 0dd18b2..115f454 100644 --- a/src/main/java/net/geedge/asw/module/app/service/impl/ApplicationMergeServiceImpl.java +++ b/src/main/java/net/geedge/asw/module/app/service/impl/ApplicationMergeServiceImpl.java @@ -126,9 +126,13 @@ public class ApplicationMergeServiceImpl extends ServiceImpl fileContent = this.getFileContent(repository, path, diff.getNewId().toObjectId()); + Map fileContent = this.getFileContent(repository, newPath, diff.getNewId().toObjectId()); encoding = T.MapUtil.getStr(fileContent, "encoding", ""); newContent = T.MapUtil.getStr(fileContent, "content", ""); break; } case DELETE: { - path = diff.getOldPath(); - Map fileContent = this.getFileContent(repository, path, diff.getOldId().toObjectId()); + Map fileContent = this.getFileContent(repository, oldPath, diff.getOldId().toObjectId()); encoding = T.MapUtil.getStr(fileContent, "encoding", ""); oldContent = T.MapUtil.getStr(fileContent, "content", ""); break; } case MODIFY: { - path = diff.getOldPath(); - Map fileContent = this.getFileContent(repository, path, diff.getOldId().toObjectId()); + Map fileContent = this.getFileContent(repository, oldPath, diff.getOldId().toObjectId()); oldContent = T.MapUtil.getStr(fileContent, "content", ""); - Map fileContent1 = this.getFileContent(repository, path, diff.getNewId().toObjectId()); + Map fileContent1 = this.getFileContent(repository, newPath, diff.getNewId().toObjectId()); encoding = T.MapUtil.getStr(fileContent1, "encoding", ""); newContent = T.MapUtil.getStr(fileContent1, "content", ""); break; } + case RENAME: { + break; + } default: break; } files.add( T.MapUtil.builder() - .put("path", path) + .put("oldPath", oldPath) + .put("newPath", newPath) .put("addedLines", addedLines) .put("removedLines", deletedLines) .put("encoding", encoding)