< prev index next > cli/src/main/java/org/openjdk/skara/cli/GitSync.java
Print this page
System.err.println(message);
System.exit(1);
return new IOException("will never reach here");
}
- private static int fetch() throws IOException, InterruptedException {
- var pb = new ProcessBuilder("git", "fetch");
- pb.inheritIO();
- return pb.start().waitFor();
- }
-
private static int pull() throws IOException, InterruptedException {
var pb = new ProcessBuilder("git", "pull");
pb.inheritIO();
return pb.start().waitFor();
}
.optional(),
Switch.shortcut("")
.fullname("pull")
.helptext("Pull current branch from origin after successful sync")
.optional(),
- Switch.shortcut("")
- .fullname("fetch")
- .helptext("Fetch current branch from origin after successful sync")
- .optional(),
Switch.shortcut("m")
.fullname("mercurial")
.helptext("Force use of mercurial")
.optional(),
Switch.shortcut("")
var fetchHead = repo.fetch(upstreamPullPath, branch.hash().hex());
repo.push(fetchHead, originPushPath, name);
System.out.println("done");
}
- if (arguments.contains("fetch")) {
- int err = fetch();
- if (err != 0) {
- System.exit(err);
- }
}
if (arguments.contains("pull")) {
int err = pull();
if (err != 0) {
< prev index next >