fix(check_upstream_updates): compare template repo URL case-insensitively (#273)

GitHub serves repo paths case-insensitively, so a direct clone from https://github.com/madslorentzen/ai-job-search (lowercased) triggered the fork-vs-self warning even though origin is the template repo itself. Lowercase both sides of the check.

New test clones with a lowercased URL: fails on the previous check, passes with this fix.
This commit is contained in:
Oscar Madera
2026-08-02 21:15:28 +02:00
committed by GitHub
parent 4f7f11ef4e
commit 0433f3e332
2 changed files with 18 additions and 1 deletions
+16
View File
@@ -98,6 +98,22 @@ class DirectCloneFallbackTests(UpstreamCheckerRepoFixture):
self.assertNotIn("does not point to the ai-job-search template repo", result.stdout)
self.assertIn("up to date with origin/master", result.stdout)
def test_clone_with_lowercased_template_url_falls_back_without_fork_warning(self):
# GitHub serves repo paths case-insensitively, so a clone from
# https://github.com/madslorentzen/ai-job-search is still the template.
subprocess.run(
["git", "remote", "set-url", "origin", TEMPLATE_URL.lower()],
cwd=self.root,
check=True,
capture_output=True,
)
result = self.run_checker("--remote", "upstream")
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
self.assertIn("Falling back to 'origin'", result.stdout)
self.assertNotIn("does not point to the ai-job-search template repo", result.stdout)
class UpstreamRemotePresentTests(UpstreamCheckerRepoFixture):
def setUp(self):