Fix issue with pulling 2 new identical binary files with known name

This commit is contained in:
Winston Li
2015-08-05 19:41:05 +01:00
parent 4fbd6eaabe
commit 70c963c38f
12 changed files with 167 additions and 4 deletions
@@ -38,11 +38,13 @@ public class ResourceFetcher {
} else {
Util.sout("Found (" + projectName + "): " + url);
Util.sout("At (" + projectName + "): " + path);
RawFile rawFile = new RepositoryObjectTreeWalker(repository).getDirectoryContents().getFileTable().get(path);
if (rawFile != null) {
contents = fetchedUrls.get(url);
if (contents == null) {
RawFile rawFile = new RepositoryObjectTreeWalker(repository).getDirectoryContents().getFileTable().get(path);
if (rawFile == null) {
throw new IllegalStateException("file was not in the current commit, or the git tree, yet path was not null");
}
contents = rawFile.getContents();
} else {
contents = fetchedUrls.get(url);
}
}
return new RepositoryFile(newPath, contents);