Skip to content

The Unified and Autonomous Development Platform

Use original file mode when edit file online

robin shine1ca74c93c507
diff --git a/commons.git/src/main/java/com/pmease/commons/git/FileEdit.java b/commons.git/src/main/java/com/pmease/commons/git/FileEdit.java
index ca18e06b11..349bcddce8 100644
--- a/commons.git/src/main/java/com/pmease/commons/git/FileEdit.java
+++ b/commons.git/src/main/java/com/pmease/commons/git/FileEdit.java
@@ -72,7 +72,7 @@ public class FileEdit implements Serializable {
if (name.equals(currentNewPath)) {
newPathFound = true;
ObjectId blobId = inserter.insert(Constants.OBJ_BLOB, newFile.getContent());
- entries.add(new TreeFormatterEntry(name, FileMode.REGULAR_FILE, blobId));
+ entries.add(new TreeFormatterEntry(name, treeWalk.getFileMode(0), blobId));
}
} else if (name.equals(currentNewPath)) {
throw new ObjectAlreadyExistException("Path already exist: " + treeWalk.getPathString());