fix fetch MimeType fail for git

This commit is contained in:
Timi
2025-07-11 20:30:48 +08:00
parent c86d7b0d2c
commit 329b6cb23d

View File

@ -175,7 +175,7 @@ public class RepositoryServiceImplement implements RepositoryService {
// 根据文件名猜测 // 根据文件名猜测
return new MimetypesFileTypeMap().getContentType(Network.uriFileName(path)); return new MimetypesFileTypeMap().getContentType(Network.uriFileName(path));
} else { } else {
repoPath = "%s/%s.git".formatted(repoPath, repoName); repoPath = "%s/%s.git".formatted(repoPath, repoName.toLowerCase());
// 仓库 // 仓库
@Cleanup @Cleanup
org.eclipse.jgit.lib.Repository repo = new FileRepositoryBuilder().setGitDir(Path.of(repoPath).toFile()).build(); org.eclipse.jgit.lib.Repository repo = new FileRepositoryBuilder().setGitDir(Path.of(repoPath).toFile()).build();