mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +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,
|
private FileObject createFileObject(org.eclipse.jgit.lib.Repository repo,
|
||||||
BrowseCommandRequest request, ObjectId revId, TreeWalk treeWalk)
|
BrowseCommandRequest request, ObjectId revId, TreeWalk treeWalk)
|
||||||
throws IOException, RevisionNotFoundException {
|
throws IOException, RevisionNotFoundException {
|
||||||
FileObject file;
|
|
||||||
|
|
||||||
try
|
FileObject file = new FileObject();
|
||||||
{
|
|
||||||
file = new FileObject();
|
|
||||||
|
|
||||||
String path = treeWalk.getPathString();
|
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;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,21 +316,17 @@ public class GitBrowseCommand extends AbstractGitCommand
|
|||||||
while (treeWalk.next())
|
while (treeWalk.next())
|
||||||
{
|
{
|
||||||
|
|
||||||
FileObject fo = createFileObject(repo, request, revId, treeWalk);
|
FileObject fileObject = createFileObject(repo, request, revId, treeWalk);
|
||||||
if (!fo.getPath().startsWith(parent.getPath())) {
|
if (!fileObject.getPath().startsWith(parent.getPath())) {
|
||||||
parent.setChildren(files);
|
parent.setChildren(files);
|
||||||
return fo;
|
return fileObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
files.add(fileObject);
|
||||||
|
|
||||||
if (fo != null)
|
if (request.isRecursive() && fileObject.isDirectory()) {
|
||||||
{
|
|
||||||
files.add(fo);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request.isRecursive() && fo.isDirectory()) {
|
|
||||||
treeWalk.enterSubtree();
|
treeWalk.enterSubtree();
|
||||||
FileObject rc = findChildren(fo, repo, request, revId, treeWalk);
|
FileObject rc = findChildren(fileObject, repo, request, revId, treeWalk);
|
||||||
if (rc != null) {
|
if (rc != null) {
|
||||||
files.add(rc);
|
files.add(rc);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user