@@ -277,9 +277,18 @@ protected PasswordAuthentication getPasswordAuthentication() {
277
277
public String getRepoUrl () {
278
278
return repo .getRepoUrl ();
279
279
}
280
-
280
+
281
281
@ Override
282
- public String getFileContent (String branchName , String fileRelativePath , String revision ) {
282
+ public String getFileContentFromBranch (String branchName , String filePath ) throws EVCSFileNotFound {
283
+ return getFileContent (branchName , filePath , null );
284
+ }
285
+
286
+ @ 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 ) {
283
292
try (IVCSLockedWorkingCopy wc = repo .getVCSLockedWorkingCopy ();
284
293
Git git = getLocalGit (wc );
285
294
Repository gitRepo = git .getRepository ();
@@ -309,7 +318,7 @@ public String getFileContent(String branchName, String fileRelativePath, String
309
318
treeWalk .setRecursive (true );
310
319
treeWalk .setFilter (PathFilter .create (fileRelativePath ));
311
320
if (!treeWalk .next ()) {
312
- throw new EVCSFileNotFound (getRepoUrl (), getRealBranchName ( branchName ), fileRelativePath , revision );
321
+ throw new EVCSFileNotFound (getRepoUrl (), fileRelativePath , revisionCommitId . getName () );
313
322
}
314
323
ObjectId objectId = treeWalk .getObjectId (0 );
315
324
0 commit comments