aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'worktree_test.go')
-rw-r--r--worktree_test.go120
1 files changed, 60 insertions, 60 deletions
diff --git a/worktree_test.go b/worktree_test.go
index c565e29..10774a4 100644
--- a/worktree_test.go
+++ b/worktree_test.go
@@ -252,8 +252,8 @@ func (s *RepositorySuite) TestPullAdd(c *C) {
func (s *WorktreeSuite) TestCheckout(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{})
@@ -285,12 +285,12 @@ func (s *WorktreeSuite) TestCheckoutSymlink(c *C) {
w, err := r.Worktree()
c.Assert(err, IsNil)
- w.fs.Symlink("not-exists", "bar")
+ w.Filesystem.Symlink("not-exists", "bar")
w.Add("bar")
w.Commit("foo", &CommitOptions{Author: defaultSignature()})
r.Storer.SetIndex(&index.Index{Version: 2})
- w.fs = osfs.New(filepath.Join(dir, "worktree-empty"))
+ w.Filesystem = osfs.New(filepath.Join(dir, "worktree-empty"))
err = w.Checkout(&CheckoutOptions{})
c.Assert(err, IsNil)
@@ -299,7 +299,7 @@ func (s *WorktreeSuite) TestCheckoutSymlink(c *C) {
c.Assert(err, IsNil)
c.Assert(status.IsClean(), Equals, true)
- target, err := w.fs.Readlink("bar")
+ target, err := w.Filesystem.Readlink("bar")
c.Assert(target, Equals, "not-exists")
c.Assert(err, IsNil)
}
@@ -340,8 +340,8 @@ func (s *WorktreeSuite) TestCheckoutSubmoduleInitialized(c *C) {
func (s *WorktreeSuite) TestCheckoutIndexMem(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{})
@@ -370,8 +370,8 @@ func (s *WorktreeSuite) TestCheckoutIndexOS(c *C) {
fs := osfs.New(filepath.Join(dir, "worktree"))
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err = w.Checkout(&CheckoutOptions{})
@@ -395,8 +395,8 @@ func (s *WorktreeSuite) TestCheckoutIndexOS(c *C) {
func (s *WorktreeSuite) TestCheckoutBranch(c *C) {
w := &Worktree{
- r: s.Repository,
- fs: memfs.New(),
+ r: s.Repository,
+ Filesystem: memfs.New(),
}
err := w.Checkout(&CheckoutOptions{
@@ -415,8 +415,8 @@ func (s *WorktreeSuite) TestCheckoutBranch(c *C) {
func (s *WorktreeSuite) TestCheckoutCreateWithHash(c *C) {
w := &Worktree{
- r: s.Repository,
- fs: memfs.New(),
+ r: s.Repository,
+ Filesystem: memfs.New(),
}
err := w.Checkout(&CheckoutOptions{
@@ -438,8 +438,8 @@ func (s *WorktreeSuite) TestCheckoutCreateWithHash(c *C) {
func (s *WorktreeSuite) TestCheckoutCreate(c *C) {
w := &Worktree{
- r: s.Repository,
- fs: memfs.New(),
+ r: s.Repository,
+ Filesystem: memfs.New(),
}
err := w.Checkout(&CheckoutOptions{
@@ -460,8 +460,8 @@ func (s *WorktreeSuite) TestCheckoutCreate(c *C) {
func (s *WorktreeSuite) TestCheckoutBranchAndHash(c *C) {
w := &Worktree{
- r: s.Repository,
- fs: memfs.New(),
+ r: s.Repository,
+ Filesystem: memfs.New(),
}
err := w.Checkout(&CheckoutOptions{
@@ -474,8 +474,8 @@ func (s *WorktreeSuite) TestCheckoutBranchAndHash(c *C) {
func (s *WorktreeSuite) TestCheckoutCreateMissingBranch(c *C) {
w := &Worktree{
- r: s.Repository,
- fs: memfs.New(),
+ r: s.Repository,
+ Filesystem: memfs.New(),
}
err := w.Checkout(&CheckoutOptions{
@@ -557,8 +557,8 @@ func (s *WorktreeSuite) testCheckoutBisect(c *C, url string) {
func (s *WorktreeSuite) TestCheckoutWithGitignore(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{})
@@ -586,8 +586,8 @@ func (s *WorktreeSuite) TestCheckoutWithGitignore(c *C) {
func (s *WorktreeSuite) TestStatus(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
status, err := w.Status()
@@ -635,8 +635,8 @@ func (s *WorktreeSuite) TestStatusEmptyDirty(c *C) {
func (s *WorktreeSuite) TestReset(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
commit := plumbing.NewHash("35e85108805c84807bc66a02d91535e1e24b38b9")
@@ -659,8 +659,8 @@ func (s *WorktreeSuite) TestReset(c *C) {
func (s *WorktreeSuite) TestResetMerge(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
commit := plumbing.NewHash("35e85108805c84807bc66a02d91535e1e24b38b9")
@@ -686,8 +686,8 @@ func (s *WorktreeSuite) TestResetMerge(c *C) {
func (s *WorktreeSuite) TestResetHard(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
commit := plumbing.NewHash("35e85108805c84807bc66a02d91535e1e24b38b9")
@@ -713,8 +713,8 @@ func (s *WorktreeSuite) TestResetHard(c *C) {
func (s *WorktreeSuite) TestStatusAfterCheckout(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{Force: true})
@@ -732,8 +732,8 @@ func (s *WorktreeSuite) TestStatusModified(c *C) {
fs := osfs.New(filepath.Join(dir, "worktree"))
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err = w.Checkout(&CheckoutOptions{})
@@ -755,8 +755,8 @@ func (s *WorktreeSuite) TestStatusModified(c *C) {
func (s *WorktreeSuite) TestStatusIgnored(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
w.Checkout(&CheckoutOptions{})
@@ -802,14 +802,14 @@ func (s *WorktreeSuite) TestStatusIgnored(c *C) {
func (s *WorktreeSuite) TestStatusUntracked(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{Force: true})
c.Assert(err, IsNil)
- f, err := w.fs.Create("foo")
+ f, err := w.Filesystem.Create("foo")
c.Assert(err, IsNil)
c.Assert(f.Close(), IsNil)
@@ -825,8 +825,8 @@ func (s *WorktreeSuite) TestStatusDeleted(c *C) {
fs := osfs.New(filepath.Join(dir, "worktree"))
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err = w.Checkout(&CheckoutOptions{})
@@ -872,8 +872,8 @@ func (s *WorktreeSuite) TestSubmodules(c *C) {
func (s *WorktreeSuite) TestAddUntracked(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{Force: true})
@@ -883,7 +883,7 @@ func (s *WorktreeSuite) TestAddUntracked(c *C) {
c.Assert(err, IsNil)
c.Assert(idx.Entries, HasLen, 9)
- err = util.WriteFile(w.fs, "foo", []byte("FOO"), 0755)
+ err = util.WriteFile(w.Filesystem, "foo", []byte("FOO"), 0755)
c.Assert(err, IsNil)
hash, err := w.Add("foo")
@@ -916,8 +916,8 @@ func (s *WorktreeSuite) TestAddUntracked(c *C) {
func (s *WorktreeSuite) TestAddModified(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{Force: true})
@@ -927,7 +927,7 @@ func (s *WorktreeSuite) TestAddModified(c *C) {
c.Assert(err, IsNil)
c.Assert(idx.Entries, HasLen, 9)
- err = util.WriteFile(w.fs, "LICENSE", []byte("FOO"), 0644)
+ err = util.WriteFile(w.Filesystem, "LICENSE", []byte("FOO"), 0644)
c.Assert(err, IsNil)
hash, err := w.Add("LICENSE")
@@ -955,8 +955,8 @@ func (s *WorktreeSuite) TestAddModified(c *C) {
func (s *WorktreeSuite) TestAddUnmodified(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{Force: true})
@@ -998,8 +998,8 @@ func (s *WorktreeSuite) TestAddSymlink(c *C) {
func (s *WorktreeSuite) TestRemove(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{Force: true})
@@ -1018,8 +1018,8 @@ func (s *WorktreeSuite) TestRemove(c *C) {
func (s *WorktreeSuite) TestRemoveNotExistentEntry(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{Force: true})
@@ -1033,8 +1033,8 @@ func (s *WorktreeSuite) TestRemoveNotExistentEntry(c *C) {
func (s *WorktreeSuite) TestRemoveDeletedFromWorktree(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{Force: true})
@@ -1056,8 +1056,8 @@ func (s *WorktreeSuite) TestRemoveDeletedFromWorktree(c *C) {
func (s *WorktreeSuite) TestMove(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{Force: true})
@@ -1078,8 +1078,8 @@ func (s *WorktreeSuite) TestMove(c *C) {
func (s *WorktreeSuite) TestMoveNotExistentEntry(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{Force: true})
@@ -1093,8 +1093,8 @@ func (s *WorktreeSuite) TestMoveNotExistentEntry(c *C) {
func (s *WorktreeSuite) TestMoveToExistent(c *C) {
fs := memfs.New()
w := &Worktree{
- r: s.Repository,
- fs: fs,
+ r: s.Repository,
+ Filesystem: fs,
}
err := w.Checkout(&CheckoutOptions{Force: true})