Explorar o código

Merge pull request #1280 from ChristianLempa/copilot/fix-9a7e6372-bafa-4e48-ae51-13fd16182b89

Fix: Repository fetch fails when library directory already exists
Christian Lempa hai 8 meses
pai
achega
e44a89ef04
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      cli/core/repo.py

+ 3 - 3
cli/core/repo.py

@@ -133,12 +133,12 @@ def _clone_or_pull_repo(name: str, url: str, target_path: Path, branch: Optional
                 if not success:
                     return False, f"Failed to set sparse-checkout directory: {stderr or stdout}"
                 
-                # Fetch specific branch
+                # Fetch specific branch (without attempting to update local ref)
                 fetch_args = ["fetch", "--depth", "1", "origin"]
                 if branch:
-                    fetch_args.append(f"{branch}:{branch}")
+                    fetch_args.append(branch)
                 else:
-                    fetch_args.append("main:main")
+                    fetch_args.append("main")
                 
                 success, stdout, stderr = _run_git_command(fetch_args, cwd=target_path)
                 if not success: