aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_test.go
diff options
context:
space:
mode:
authorAyman Bagabas <ayman.bagabas@gmail.com>2023-11-16 11:28:02 -0500
committerAyman Bagabas <ayman.bagabas@gmail.com>2023-11-16 14:00:38 -0500
commit05551b70f689944ab558a2b326b2174f313d372a (patch)
treed89c591da2d37b99b2cd0f6e9ea6f67a91c9ee11 /worktree_test.go
parent63b586b9559508baf7442c39db3327c91d37486c (diff)
downloadgo-git-05551b70f689944ab558a2b326b2174f313d372a.tar.gz
plumbing: fix empty uploadpack request error
If we have all what we asked for, finish the session and handle error. This is equivalent of git "Already up to date." message. Fixes: https://github.com/go-git/go-git/issues/328 Fixes: https://github.com/go-git/go-git/issues/638 Fixes: https://github.com/go-git/go-git/issues/157
Diffstat (limited to 'worktree_test.go')
-rw-r--r--worktree_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/worktree_test.go b/worktree_test.go
index 712695a..180bfb0 100644
--- a/worktree_test.go
+++ b/worktree_test.go
@@ -299,6 +299,20 @@ func (s *WorktreeSuite) TestPullAlreadyUptodate(c *C) {
c.Assert(err, Equals, NoErrAlreadyUpToDate)
}
+func (s *WorktreeSuite) TestPullDepth(c *C) {
+ r, err := Clone(memory.NewStorage(), memfs.New(), &CloneOptions{
+ URL: fixtures.Basic().One().URL,
+ Depth: 1,
+ })
+
+ c.Assert(err, IsNil)
+
+ w, err := r.Worktree()
+ c.Assert(err, IsNil)
+ err = w.Pull(&PullOptions{})
+ c.Assert(err, Equals, nil)
+}
+
func (s *WorktreeSuite) TestCheckout(c *C) {
fs := memfs.New()
w := &Worktree{