Skip to content

Handle scp-style SSH remotes correctly in git-mem source add#3

Draft
chrisribe with Copilot wants to merge 6 commits into
feature/multi-sourcefrom
copilot/review-current-branch
Draft

Handle scp-style SSH remotes correctly in git-mem source add#3
chrisribe with Copilot wants to merge 6 commits into
feature/multi-sourcefrom
copilot/review-current-branch

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown

Merge-readiness review surfaced a functional blocker: source add misclassified common scp-style Git remotes (git@host:org/repo.git) as local paths and failed with Not a git repository. This PR updates source classification so valid SSH remotes follow the clone path while preserving local-repo behavior.

  • Source classification fix

    • cmd_source add now resolves and checks local git repos first (<path>/.git), then treats URL-like inputs (including scp-style user@host:path) as clone targets.
    • Prevents false local-path failures for standard SSH remote syntax.
  • Regression coverage

    • Extended tests/test-source.sh with scp-style SSH cases to assert:
      • remote path is handled via clone flow (Clone failed on unreachable host),
      • local validation error (Not a git repository) is not emitted for that path.
    • Uses distinct source names/fixtures to avoid test coupling.
# Before: treated as local path, failed validation
git-mem source add team git@github.com:org/memory.git
# error: Not a git repository: git@github.com:org/memory.git

# After: treated as remote, enters clone path
git-mem source add team git@github.com:org/memory.git
# Cloning git@github.com:org/memory.git...
Original prompt

Review current branch and rate if ready for merge

Copilot AI changed the title [WIP] Review current branch for merge readiness Handle scp-style SSH remotes correctly in git-mem source add Jul 13, 2026
Copilot AI requested a review from chrisribe July 13, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants