From 919e77001d3bf564557d8b9c553285ac32d02ca7 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 27 Jun 2018 14:56:46 +0200 Subject: pkg/vcs: add fuchsia support For now only checking out and polling. --- pkg/vcs/git.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'pkg/vcs/git.go') diff --git a/pkg/vcs/git.go b/pkg/vcs/git.go index d1595aaa8..f064dadb1 100644 --- a/pkg/vcs/git.go +++ b/pkg/vcs/git.go @@ -1,7 +1,6 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. -// Package vcs provides helper functions for working with git repositories. package vcs import ( @@ -137,10 +136,10 @@ func (git *git) initRepo() error { } func (git *git) HeadCommit() (*Commit, error) { - return git.GetCommit("HEAD") + return git.getCommit("HEAD") } -func (git *git) GetCommit(commit string) (*Commit, error) { +func (git *git) getCommit(commit string) (*Commit, error) { output, err := runSandboxed(git.dir, "git", "log", "--format=%H%n%s%n%ae%n%ad%n%b", "-n", "1", commit) if err != nil { return nil, err @@ -285,7 +284,7 @@ func (git *git) Bisect(bad, good string, trace io.Writer, pred func() (BisectRes dir := git.dir runSandboxed(dir, "git", "bisect", "reset") runSandboxed(dir, "git", "reset", "--hard") - firstBad, err := git.GetCommit(bad) + firstBad, err := git.getCommit(bad) if err != nil { return nil, err } @@ -369,12 +368,3 @@ func gitReleaseTagToInt(tag string) uint64 { } return v1*1e6 + v2*1e3 + v3 } - -func runSandboxed(dir, command string, args ...string) ([]byte, error) { - cmd := osutil.Command(command, args...) - cmd.Dir = dir - if err := osutil.Sandbox(cmd, true, false); err != nil { - return nil, err - } - return osutil.Run(timeout, cmd) -} -- cgit mrf-deployment