From da410ded51ddab7729992540b54c739e43090244 Mon Sep 17 00:00:00 2001 From: Manuel Carmona Date: Mon, 7 Aug 2017 12:11:00 +0200 Subject: *: windows support, some more fixes (2) (#536) * fixed windows failed test: "143 FAIL: worktree_test.go:314: WorktreeSuite.TestFilenameNormalization" * fixed windows failed test: "489: FAIL: auth_method_test.go:106: SuiteCommon.TestNewSSHAgentAuthNoAgent" * fixed windows failed test: "279 FAIL: server_test.go:50: ServerSuite.TestClone" fixed windows failed test: "298 FAIL: server_test.go:37: ServerSuite.TestPush" * fixed windows failed test: "316 FAIL: :26: UploadPackSuite.TearDownSuite" * fixed windows failed test: "FAIL: :6: IndexSuite.TearDownSuite" --- plumbing/transport/file/server_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'plumbing/transport/file/server_test.go') diff --git a/plumbing/transport/file/server_test.go b/plumbing/transport/file/server_test.go index ee72282..080beef 100644 --- a/plumbing/transport/file/server_test.go +++ b/plumbing/transport/file/server_test.go @@ -35,6 +35,10 @@ func (s *ServerSuite) SetUpSuite(c *C) { } func (s *ServerSuite) TestPush(c *C) { + if !s.checkExecPerm(c) { + c.Skip("go-git binary has not execution permissions") + } + // git <2.0 cannot push to an empty repository without a refspec. cmd := exec.Command("git", "push", "--receive-pack", s.ReceivePackBin, @@ -48,6 +52,10 @@ func (s *ServerSuite) TestPush(c *C) { } func (s *ServerSuite) TestClone(c *C) { + if !s.checkExecPerm(c) { + c.Skip("go-git binary has not execution permissions") + } + pathToClone := c.MkDir() cmd := exec.Command("git", "clone", @@ -59,3 +67,10 @@ func (s *ServerSuite) TestClone(c *C) { out, err := cmd.CombinedOutput() c.Assert(err, IsNil, Commentf("combined stdout and stderr:\n%s\n", out)) } + +func (s *ServerSuite) checkExecPerm(c *C) bool { + const userExecPermMask = 0100 + info, err := os.Stat(s.ReceivePackBin) + c.Assert(err, IsNil) + return (info.Mode().Perm() & userExecPermMask) == userExecPermMask +} -- cgit