Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-sync should use APIs to find upstream #262

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -137,7 +137,9 @@ private List<String> botSpecificChecks() throws IOException {
var sourceBranch = mergeSourceBranch();
if (sourceBranch.isPresent() && sourceRepo.isPresent()) {
try {
var mergeSourceRepo = pr.repository().forge().repository(sourceRepo.get()).get();
var mergeSourceRepo = pr.repository().forge().repository(sourceRepo.get()).orElseThrow(() ->
new RuntimeException("Could not find repository " + sourceRepo.get())
);
try {
var sourceHash = prInstance.localRepo().fetch(mergeSourceRepo.url(), sourceBranch.get());
if (!prInstance.localRepo().isAncestor(commits.get(1).hash(), sourceHash)) {
@@ -208,7 +208,7 @@ private void generateVersion(Path folder) throws IOException {
public HostedRepository build() {
try {
var host = TestHost.createNew(List.of(new HostUser(1, "cu", "Census User")));
var repository = host.repository("census").get();
var repository = host.repository("census").orElseThrow();
var folder = Files.createTempDirectory("censusbuilder");
var localRepository = Repository.init(folder, VCS.GIT);

@@ -91,7 +91,7 @@ public IssueTracker createIssueHost(int userIndex) {

@Override
public HostedRepository getHostedRepository(Forge host) {
return host.repository(config.get("project").asString()).get();
return host.repository(config.get("project").asString()).orElseThrow();
}

@Override
@@ -128,7 +128,7 @@ public IssueTracker createIssueHost(int userIndex) {

@Override
public HostedRepository getHostedRepository(Forge host) {
return host.repository(config.get("project").asString()).get();
return host.repository(config.get("project").asString()).orElseThrow();
}

@Override
@@ -165,7 +165,7 @@ public IssueTracker createIssueHost(int userIndex) {

@Override
public HostedRepository getHostedRepository(Forge host) {
return host.repository(config.get("project").asString()).get();
return host.repository(config.get("project").asString()).orElseThrow();
}

@Override
@@ -209,7 +209,7 @@ public IssueTracker createIssueHost(int userIndex) {

@Override
public HostedRepository getHostedRepository(Forge host) {
return host.repository("test").get();
return host.repository("test").orElseThrow();
}

@Override