-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8154618
commit f614184
Showing
3 changed files
with
52 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,27 @@ | ||
package org.strangeway.disttest | ||
|
||
class KernelRepo { | ||
private static final gitUrl = "git@server.home:/home/git/linux-stable.git" | ||
|
||
static String getRepoPath() { | ||
File repoDir = new File("kernelRepo/linux-stable") | ||
if (repoDir.isDirectory()) { | ||
return repoDir.getPath() | ||
} | ||
Process process = new ProcessBuilder("git", "clone", "--no-checkout", gitUrl).directory(new File("kernelRepo")).start(); | ||
process.consumeProcessOutput() | ||
process.waitFor() | ||
assert 0 == process.exitValue() | ||
return repoDir.getPath() | ||
} | ||
|
||
static String[] getVersionBetweenTags(String from, String to){ | ||
Process process = new ProcessBuilder("git", "log", "--pretty=format:%H", "$from..$to").directory(new File(getRepoPath())).start(); | ||
StringBuilder sout = new StringBuilder() | ||
StringBuilder serr = new StringBuilder() | ||
process.consumeProcessOutput(sout, serr) | ||
process.waitFor() | ||
assert 0 == process.exitValue() | ||
return sout.tokenize("\n").reverse() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters