Skip to content

Commit 23acbee

Browse files
committed
fix: allow manual path repos without requiring git metadata
1 parent 69bad03 commit 23acbee

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

git_auto_sync/wizard.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,22 @@ def _resolve_repo_token(token: str, found: list[str], scan_parent: Path) -> list
185185
return results
186186

187187
candidate = Path(token).expanduser()
188-
# explicit path input support.
189-
if "//" in token or token.startswith(("/", "./", "../", "~")):
188+
explicit_path = (
189+
candidate.is_absolute()
190+
or token.startswith(("./", "../", "~"))
191+
or "/" in token
192+
or "\\" in token
193+
or (len(token) >= 2 and token[1:2] == ":")
194+
)
195+
196+
# explicit path input support (allow existing directories even without .git).
197+
if explicit_path:
190198
if not candidate.is_absolute():
191199
candidate = (scan_parent / candidate).expanduser()
192-
if candidate.exists() and (candidate / ".git").exists():
200+
if candidate.exists() and candidate.is_dir():
193201
results.append(str(candidate.resolve()))
194202
else:
195-
print(f" ⚠ path not a git repo: {token!r}")
203+
print(f" ⚠ path not a directory: {token!r}")
196204
return results
197205

198206
# fallback to substring match in discovered paths

0 commit comments

Comments
 (0)