MCPcopy Create free account
hub / github.com/github/gh-aw / TestHasLocalModifications

Function TestHasLocalModifications

pkg/cli/update_command_test.go:591–723  ·  view source on GitHub ↗

TestHasLocalModifications tests the local modifications detection

(t *testing.T)

Source from the content-addressed store, hash-verified

589
590// TestHasLocalModifications tests the local modifications detection
591func TestHasLocalModifications(t *testing.T) {
592 tests := []struct {
593 name string
594 sourceContent string
595 localContent string
596 sourceSpec string
597 expectModified bool
598 description string
599 }{
600 {
601 name: "no modifications - identical content",
602 sourceContent: `---
603on: push
604engine: claude
605---
606
607# Test Workflow
608
609Test content.`,
610 localContent: `---
611on: push
612engine: claude
613source: test/repo/workflow.md@v1.0.0
614---
615
616# Test Workflow
617
618Test content.`,
619 sourceSpec: "test/repo/workflow.md@v1.0.0",
620 expectModified: false,
621 description: "Local file with source field should match source without it",
622 },
623 {
624 name: "local modifications in frontmatter",
625 sourceContent: `---
626on: push
627engine: claude
628---
629
630# Test Workflow
631
632Test content.`,
633 localContent: `---
634on: push
635engine: claude
636permissions:
637 contents: read
638source: test/repo/workflow.md@v1.0.0
639---
640
641# Test Workflow
642
643Test content.`,
644 sourceSpec: "test/repo/workflow.md@v1.0.0",
645 expectModified: true,
646 description: "Local has extra permissions field",
647 },
648 {

Callers

nothing calls this directly

Calls 3

hasLocalModificationsFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected