mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-01 21:29:47 +01:00
Throw not found exceptions for log between branches
This commit is contained in:
@@ -49,6 +49,7 @@ import org.eclipse.jgit.treewalk.filter.PathFilter;
|
||||
import org.eclipse.jgit.treewalk.filter.TreeFilter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import sonia.scm.NotFoundException;
|
||||
import sonia.scm.repository.Changeset;
|
||||
import sonia.scm.repository.ChangesetPagingResult;
|
||||
import sonia.scm.repository.GitChangesetConverter;
|
||||
@@ -206,6 +207,9 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
|
||||
|
||||
if (!Strings.isNullOrEmpty(request.getAncestorChangeset())) {
|
||||
ancestorId = repository.resolve(request.getAncestorChangeset());
|
||||
if (ancestorId == null) {
|
||||
throw notFound(entity("Revision", request.getAncestorChangeset()).in(this.repository));
|
||||
}
|
||||
}
|
||||
|
||||
revWalk = new RevWalk(repository);
|
||||
@@ -245,6 +249,8 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (ancestorId != null) {
|
||||
throw notFound(entity("Revision", request.getBranch()).in(this.repository));
|
||||
}
|
||||
|
||||
if (branch != null) {
|
||||
@@ -263,6 +269,10 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
|
||||
{
|
||||
throw notFound(entity("Revision", e.getObjectId().getName()).in(repository));
|
||||
}
|
||||
catch (NotFoundException e)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new InternalRepositoryException(repository, "could not create change log", ex);
|
||||
|
||||
Reference in New Issue
Block a user