Skip to content

Commit bcc7660

Browse files
authored
Fix the directory check method (#217)
1 parent e99e3d4 commit bcc7660

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/io/jenkins/plugins/gitlabbranchsource/GitLabSCMFile.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ protected Type type() throws IOException, InterruptedException {
9797
throw new IOException(e);
9898
}
9999
try {
100-
gitLabApi.getRepositoryApi().getTree(projectPath, getPath(), ref);
100+
List<TreeItem> files = gitLabApi.getRepositoryApi().getTree(projectPath, getPath(), ref);
101+
if (files.size() == 0) {
102+
return Type.NONEXISTENT;
103+
}
101104
return Type.DIRECTORY;
102105
} catch (GitLabApiException ex) {
103106
if (e.getHttpStatus() != 404) {

0 commit comments

Comments
 (0)