MCPcopy Index your code
hub / github.com/git-lfs/git-lfs / TestRefUpdateCurrentDefault

Function TestRefUpdateCurrentDefault

git/refs_test.go:39–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestRefUpdateCurrentDefault(t *testing.T) {
40 env := newEnv(map[string][]string{
41 "push.default": []string{"current"},
42 "branch.local.remote": []string{"origin"},
43 "branch.local.merge": []string{"tracked"},
44 })
45
46 u := NewRefUpdate(env, "origin", ParseRef("refs/heads/local", ""), nil)
47 assert.Equal(t, "local", u.RemoteRef().Name)
48 assert.Equal(t, RefTypeLocalBranch, u.RemoteRef().Type)
49}
50
51func TestRefUpdateExplicitLocalAndRemoteRefs(t *testing.T) {
52 u := NewRefUpdate(nil, "", ParseRef("refs/heads/local", "abc123"), ParseRef("refs/heads/remote", "def456"))

Callers

nothing calls this directly

Calls 5

RemoteRefMethod · 0.95
newEnvFunction · 0.85
NewRefUpdateFunction · 0.85
ParseRefFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected