diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-12-06 15:46:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-06 15:46:09 +0100 |
commit | 22fe81f342538ae51442a72356036768f7f1a2f9 (patch) | |
tree | ccfe9fcd48d3c8f349b42413f71f26ba23a4cba9 /fixtures | |
parent | 4b5849db76905830e0124b6b9f4294ee13308e0f (diff) | |
download | go-git-22fe81f342538ae51442a72356036768f7f1a2f9.tar.gz |
protocol/packp: UploadPackResponse implementation (#161)
* plumbing/protocol: paktp avoid duplication of haves, wants and shallow
* protocol/pakp: UploadPackResponse implementation
* changes
* changes
* changes
* debug
* changes
Diffstat (limited to 'fixtures')
-rw-r--r-- | fixtures/fixtures.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fixtures/fixtures.go b/fixtures/fixtures.go index 503f2ea..7cfceae 100644 --- a/fixtures/fixtures.go +++ b/fixtures/fixtures.go @@ -3,6 +3,7 @@ package fixtures import ( "fmt" "go/build" + "io/ioutil" "os" "path/filepath" @@ -195,6 +196,25 @@ func (f *Fixture) DotGit() fs.Filesystem { return osfs.New(path) } +func (f *Fixture) Worktree() fs.Filesystem { + fn := filepath.Join(RootFolder, DataFolder, fmt.Sprintf("git-%s.tgz", f.DotGitHash)) + git, err := tgz.Extract(fn) + if err != nil { + panic(err) + } + + worktree, err := ioutil.TempDir("", "worktree") + if err != nil { + panic(err) + } + + if err := os.Rename(git, filepath.Join(worktree, ".git")); err != nil { + panic(err) + } + + return osfs.New(worktree) +} + type Fixtures []*Fixture func (g Fixtures) Test(c *check.C, test func(*Fixture)) { |