mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
Remove pseudo error handling
This commit is contained in:
@@ -168,11 +168,8 @@ public class GitBrowseCommand extends AbstractGitCommand
|
||||
private FileObject createFileObject(org.eclipse.jgit.lib.Repository repo,
|
||||
BrowseCommandRequest request, ObjectId revId, TreeWalk treeWalk)
|
||||
throws IOException, RevisionNotFoundException {
|
||||
FileObject file;
|
||||
|
||||
try
|
||||
{
|
||||
file = new FileObject();
|
||||
FileObject file = new FileObject();
|
||||
|
||||
String path = treeWalk.getPathString();
|
||||
|
||||
@@ -217,18 +214,6 @@ public class GitBrowseCommand extends AbstractGitCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (MissingObjectException ex)
|
||||
{
|
||||
file = null;
|
||||
logger.error("could not fetch object for id {}", revId);
|
||||
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("could not fetch object", ex);
|
||||
}
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
@@ -331,21 +316,17 @@ public class GitBrowseCommand extends AbstractGitCommand
|
||||
while (treeWalk.next())
|
||||
{
|
||||
|
||||
FileObject fo = createFileObject(repo, request, revId, treeWalk);
|
||||
if (!fo.getPath().startsWith(parent.getPath())) {
|
||||
FileObject fileObject = createFileObject(repo, request, revId, treeWalk);
|
||||
if (!fileObject.getPath().startsWith(parent.getPath())) {
|
||||
parent.setChildren(files);
|
||||
return fo;
|
||||
return fileObject;
|
||||
}
|
||||
|
||||
files.add(fileObject);
|
||||
|
||||
if (fo != null)
|
||||
{
|
||||
files.add(fo);
|
||||
}
|
||||
|
||||
if (request.isRecursive() && fo.isDirectory()) {
|
||||
if (request.isRecursive() && fileObject.isDirectory()) {
|
||||
treeWalk.enterSubtree();
|
||||
FileObject rc = findChildren(fo, repo, request, revId, treeWalk);
|
||||
FileObject rc = findChildren(fileObject, repo, request, revId, treeWalk);
|
||||
if (rc != null) {
|
||||
files.add(rc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user