Skip to content

Commit 8d9c128

Browse files
test/gitindex: assert clone URL changes no longer rewrite remote origin
After removing remote.origin.url sync from existing-clone updates, keep an explicit regression check that captures the behavior boundary. The integration test now changes the clone URL during a metadata update and verifies remote.origin.url remains at the originally cloned value while zoekt config still updates and triggers a destination return. Test Plan: go test ./... Amp-Thread-ID: https://ampcode.com/threads/T-019d0c05-51b0-77ee-a1dc-cb60ce14712d Co-authored-by: Amp <amp@ampcode.com>
1 parent 5a8c9b5 commit 8d9c128

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gitindex/clone_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ func gitConfigValue(t *testing.T, repoDir, key string) (string, bool) {
8585
func TestCloneRepoUpdatesExistingSettings(t *testing.T) {
8686
root := t.TempDir()
8787
originA := filepath.Join(root, "origin-a.git")
88+
originB := filepath.Join(root, "origin-b.git")
8889
runScript(t, root, "git init --bare "+originA)
90+
runScript(t, root, "git init --bare "+originB)
8991

9092
destRoot := filepath.Join(root, "repos")
9193
repoDest := filepath.Join(destRoot, "owner", "repo.git")
@@ -112,7 +114,7 @@ func TestCloneRepoUpdatesExistingSettings(t *testing.T) {
112114
t.Fatalf("got %q want empty destination for unchanged settings", dest)
113115
}
114116

115-
dest, err = CloneRepo(destRoot, "owner/repo", originA, map[string]string{
117+
dest, err = CloneRepo(destRoot, "owner/repo", originB, map[string]string{
116118
"zoekt.name": "github.com/owner/repo",
117119
"zoekt.description": "",
118120
})

0 commit comments

Comments
 (0)