diff --git a/internal/infra/git/branch_test.go b/internal/infra/git/branch_test.go new file mode 100644 index 0000000..5c08695 --- /dev/null +++ b/internal/infra/git/branch_test.go @@ -0,0 +1,23 @@ +package git + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestParseRemoteBranches(t *testing.T) { + t.Parallel() + input := []byte("aabbccdd\trefs/heads/main\n" + + "eeff0011\trefs/heads/develop\n" + + "22334455\trefs/heads/feature/foo\n" + + "deadbeef\trefs/tags/v1.0\n") + got := parseRemoteBranches(input) + require.Equal(t, []string{"main", "develop", "feature/foo"}, got) +} + +func TestParseRemoteBranches_Empty(t *testing.T) { + t.Parallel() + got := parseRemoteBranches(nil) + require.Nil(t, got) +}