MCPcopy Create free account
hub / github.com/entireio/git-sync / TestValidateMappingsValidFullRef

Function TestValidateMappingsValidFullRef

internal/planner/planner_test.go:1086–1103  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1084}
1085
1086func TestValidateMappingsValidFullRef(t *testing.T) {
1087 normalized, err := validation.ValidateMappings([]RefMapping{
1088 {Source: "refs/heads/main", Target: "refs/heads/upstream-main"},
1089 }, false)
1090 if err != nil {
1091 t.Fatalf("unexpected error: %v", err)
1092 }
1093 if len(normalized) != 1 {
1094 t.Fatalf("expected 1 normalized mapping, got %d", len(normalized))
1095 }
1096 nm := normalized[0]
1097 if nm.SourceRef != "refs/heads/main" {
1098 t.Fatalf("expected source ref refs/heads/main, got %s", nm.SourceRef)
1099 }
1100 if nm.TargetRef != "refs/heads/upstream-main" {
1101 t.Fatalf("expected target ref refs/heads/upstream-main, got %s", nm.TargetRef)
1102 }
1103}
1104
1105func TestBuildDesiredRefsEmptySource(t *testing.T) {
1106 // Empty source ref map with a branch filter: SelectBranches finds nothing,

Callers

nothing calls this directly

Calls 1

ValidateMappingsFunction · 0.92

Tested by

no test coverage detected