summaryrefslogtreecommitdiff
path: root/push_test.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2015-01-04 17:05:11 +0000
committerCarlos Martín Nieto <[email protected]>2015-01-04 17:05:11 +0000
commitd57246fb74404ed8b18d0d26d2b02b326ffd2cbe (patch)
tree10a2ee2916f886a7324b21e8401b02749a6ff365 /push_test.go
parentdff9badc05f5fd98e8f6d002e1537c7ee3ef634f (diff)
Update to libgit2 master
This gets rid of the Push object. All network now goes through the Remote object.
Diffstat (limited to 'push_test.go')
-rw-r--r--push_test.go47
1 files changed, 0 insertions, 47 deletions
diff --git a/push_test.go b/push_test.go
index 3911875..cd708c6 100644
--- a/push_test.go
+++ b/push_test.go
@@ -3,55 +3,8 @@ package git
import (
"os"
"testing"
- "time"
)
-func Test_Push_ToRemote(t *testing.T) {
- repo := createBareTestRepo(t)
- defer os.RemoveAll(repo.Path())
- repo2 := createTestRepo(t)
- defer os.RemoveAll(repo2.Workdir())
-
- remote, err := repo2.CreateRemote("test_push", repo.Path())
- checkFatal(t, err)
-
- index, err := repo2.Index()
- checkFatal(t, err)
-
- index.AddByPath("README")
-
- err = index.Write()
- checkFatal(t, err)
-
- newTreeId, err := index.WriteTree()
- checkFatal(t, err)
-
- tree, err := repo2.LookupTree(newTreeId)
- checkFatal(t, err)
-
- sig := &Signature{Name: "Rand Om Hacker", Email: "[email protected]", When: time.Now()}
- // this should cause master branch to be created if it does not already exist
- _, err = repo2.CreateCommit("HEAD", sig, sig, "message", tree)
- checkFatal(t, err)
-
- push, err := remote.NewPush()
- checkFatal(t, err)
-
- err = push.AddRefspec("refs/heads/master")
- checkFatal(t, err)
-
- err = push.Finish()
- checkFatal(t, err)
-
- err = push.StatusForeach(func(ref string, msg string) int {
- return 0
- })
- checkFatal(t, err)
-
- defer remote.Free()
- defer repo.Free()
-}
-
func TestRemotePush(t *testing.T) {
repo := createBareTestRepo(t)
defer os.RemoveAll(repo.Path())