Skip to content

Commit 9bf2e28

Browse files
committed
Add author_name and author_email to RepositoryFile (Repository files API)
1 parent d989951 commit 9bf2e28

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
java temurin-11.0.28+6

gitlab4j-api/src/main/java/org/gitlab4j/api/RepositoryFileApi.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,8 @@ protected Form createForm(RepositoryFile file, String branchName, String commitM
454454
form.param("content", content);
455455

456456
addFormParam(form, "commit_message", commitMessage, true);
457+
addFormParam(form, "author_email", file.getAuthorEmail(), false);
458+
addFormParam(form, "author_name", file.getAuthorName(), false);
457459
return (form);
458460
}
459461

gitlab4j-models/src/main/java/org/gitlab4j/api/models/RepositoryFile.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public class RepositoryFile implements Serializable {
2121
private String blobId;
2222
private String commitId;
2323
private String lastCommitId;
24+
private String authorName;
25+
private String authorEmail;
2426

2527
public String getFileName() {
2628
return fileName;
@@ -102,6 +104,22 @@ public void setLastCommitId(String lastCommitId) {
102104
this.lastCommitId = lastCommitId;
103105
}
104106

107+
public String getAuthorName() {
108+
return authorName;
109+
}
110+
111+
public void setAuthorName(String authorName) {
112+
this.authorName = authorName;
113+
}
114+
115+
public String getAuthorEmail() {
116+
return authorEmail;
117+
}
118+
119+
public void setAuthorEmail(String authorEmail) {
120+
this.authorEmail = authorEmail;
121+
}
122+
105123
/**
106124
* Returns the content as a String, base64 decoding it if necessary.
107125
* For binary files it is recommended to use getDecodedContentAsBytes()

0 commit comments

Comments
 (0)