-
Notifications
You must be signed in to change notification settings - Fork 315
/
push_test.go
31 lines (23 loc) · 643 Bytes
/
push_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package git
import (
"testing"
)
func TestRemotePush(t *testing.T) {
t.Parallel()
repo := createBareTestRepo(t)
defer cleanupTestRepo(t, repo)
localRepo := createTestRepo(t)
defer cleanupTestRepo(t, localRepo)
remote, err := localRepo.Remotes.Create("test_push", repo.Path())
checkFatal(t, err)
defer remote.Free()
seedTestRepo(t, localRepo)
err = remote.Push([]string{"refs/heads/master"}, nil)
checkFatal(t, err)
ref, err := localRepo.References.Lookup("refs/remotes/test_push/master")
checkFatal(t, err)
defer ref.Free()
ref, err = repo.References.Lookup("refs/heads/master")
checkFatal(t, err)
defer ref.Free()
}