Skip to content

Commit 579faaa

Browse files
committed
Revert "devide getFileContent(): from branch and from revision #2"
This reverts commit a5c6961.
1 parent a5c6961 commit 579faaa

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/main/java/org/scm4j/vcs/GitVCS.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -277,18 +277,9 @@ protected PasswordAuthentication getPasswordAuthentication() {
277277
public String getRepoUrl() {
278278
return repo.getRepoUrl();
279279
}
280-
281-
@Override
282-
public String getFileContentFromBranch(String branchName, String filePath) throws EVCSFileNotFound {
283-
return getFileContent(branchName, filePath, null);
284-
}
285-
280+
286281
@Override
287-
public String getFileContentFromRevision(String revision, String filePath) throws EVCSFileNotFound {
288-
return getFileContent(null, filePath, revision);
289-
}
290-
291-
private String getFileContent(String branchName, String fileRelativePath, String revision) {
282+
public String getFileContent(String branchName, String fileRelativePath, String revision) {
292283
try (IVCSLockedWorkingCopy wc = repo.getVCSLockedWorkingCopy();
293284
Git git = getLocalGit(wc);
294285
Repository gitRepo = git.getRepository();
@@ -318,7 +309,7 @@ private String getFileContent(String branchName, String fileRelativePath, String
318309
treeWalk.setRecursive(true);
319310
treeWalk.setFilter(PathFilter.create(fileRelativePath));
320311
if (!treeWalk.next()) {
321-
throw new EVCSFileNotFound(getRepoUrl(), fileRelativePath, revisionCommitId.getName());
312+
throw new EVCSFileNotFound(getRepoUrl(), getRealBranchName(branchName), fileRelativePath, revision);
322313
}
323314
ObjectId objectId = treeWalk.getObjectId(0);
324315

0 commit comments

Comments
 (0)