Track benchmark before checkout
This commit is contained in:
@@ -55,6 +55,9 @@ func main() {
|
|||||||
log.Printf("Fetching benchmark branch")
|
log.Printf("Fetching benchmark branch")
|
||||||
fetchBenchmark()
|
fetchBenchmark()
|
||||||
time.Sleep(200 * time.Millisecond)
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
log.Printf("Tracking benchmark branch")
|
||||||
|
trackBenchmark()
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
log.Printf("Checking out benchmark branch")
|
log.Printf("Checking out benchmark branch")
|
||||||
checkoutBenchmark()
|
checkoutBenchmark()
|
||||||
time.Sleep(200 * time.Millisecond)
|
time.Sleep(200 * time.Millisecond)
|
||||||
@@ -97,8 +100,17 @@ func fetchBenchmark() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func trackBenchmark() {
|
||||||
|
gitTrack := exec.Command("git", "branch", "--track", "benchmark", "origin/benchmark")
|
||||||
|
gitTrack.Dir = "../"
|
||||||
|
out, err := gitTrack.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Could not track benchmark branch with code %v and error %v", err, string(out))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func checkoutBenchmark() {
|
func checkoutBenchmark() {
|
||||||
gitCheckout := exec.Command("git", "checkout", "origin/benchmark")
|
gitCheckout := exec.Command("git", "checkout", "benchmark")
|
||||||
gitCheckout.Dir = "../"
|
gitCheckout.Dir = "../"
|
||||||
out, err := gitCheckout.CombinedOutput()
|
out, err := gitCheckout.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user