MCPcopy Create free account
hub / github.com/cli/cli / TestParsePushRevisionReportsMalformedSymbolicRef

Function TestParsePushRevisionReportsMalformedSymbolicRef

git/client_test.go:839–849  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

837}
838
839func TestParsePushRevisionReportsMalformedSymbolicRef(t *testing.T) {
840 // Given Git returns a symbolic push ref outside refs/remotes
841 output := []byte("not/a/valid/remote/ref")
842
843 // When the push revision is parsed
844 trackingRef, err := parsePushRevision(output)
845
846 // Then the malformed ref is reported with context
847 require.EqualError(t, err, "could not parse push revision: remote tracking branch must have format refs/remotes/<remote>/<branch> but was: not/a/valid/remote/ref")
848 assert.Empty(t, trackingRef)
849}
850
851func TestParseRemoteTrackingRef(t *testing.T) {
852 tests := []struct {

Callers

nothing calls this directly

Calls 2

parsePushRevisionFunction · 0.85
EmptyMethod · 0.80

Tested by

no test coverage detected