aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/file/client_test.go
diff options
context:
space:
mode:
authorJeremy Stribling <strib@keyba.se>2017-07-31 15:34:45 -0700
committerJeremy Stribling <strib@alum.mit.edu>2017-08-03 10:46:03 -0700
commitc128f5d680f59fd125cafd90f10e39eae5f3a135 (patch)
tree234a5da875d8c01dbd7e5ebe06ab8fc845cf8100 /plumbing/transport/file/client_test.go
parent63b30fba572b7e70833fae4785c6d22f167c6641 (diff)
downloadgo-git-c128f5d680f59fd125cafd90f10e39eae5f3a135.tar.gz
plumbing: fix pack commands for the file client on Windows
The default git install on Windows doesn't come with commands for receive-pack and upload-pack in the default $PATH. Instead, use --exec-path to find pack executables in that case.
Diffstat (limited to 'plumbing/transport/file/client_test.go')
-rw-r--r--plumbing/transport/file/client_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/plumbing/transport/file/client_test.go b/plumbing/transport/file/client_test.go
index 030175e..3532a4c 100644
--- a/plumbing/transport/file/client_test.go
+++ b/plumbing/transport/file/client_test.go
@@ -14,6 +14,28 @@ import (
func Test(t *testing.T) { TestingT(t) }
+type ClientSuite struct {
+ CommonSuite
+}
+
+var _ = Suite(&ClientSuite{})
+
+func (s *ClientSuite) TestCommand(c *C) {
+ runner := &runner{
+ UploadPackBin: transport.UploadPackServiceName,
+ ReceivePackBin: transport.ReceivePackServiceName,
+ }
+ ep, err := transport.NewEndpoint(filepath.Join("fake", "repo"))
+ c.Assert(err, IsNil)
+ var emptyAuth transport.AuthMethod
+ _, err = runner.Command("git-receive-pack", ep, emptyAuth)
+ c.Assert(err, IsNil)
+
+ // Make sure we get an error for one that doesn't exist.
+ _, err = runner.Command("git-fake-command", ep, emptyAuth)
+ c.Assert(os.IsNotExist(err), Equals, true)
+}
+
const bareConfig = `[core]
repositoryformatversion = 0
filemode = true