Skip to content

fix(ingest): strip GitHub deep links before git clone#215

Open
MohammedAnasNathani wants to merge 1 commit into
alphacrack:mainfrom
MohammedAnasNathani:fix/github-deep-link-clone
Open

fix(ingest): strip GitHub deep links before git clone#215
MohammedAnasNathani wants to merge 1 commit into
alphacrack:mainfrom
MohammedAnasNathani:fix/github-deep-link-clone

Conversation

@MohammedAnasNathani

Copy link
Copy Markdown

Summary

Closes #109.

Pasting a browser deep link (…/tree/main/examples, …/blob/main/README.md) is a common first-run mistake. _URL_RE accepted it (GitLab subgroups need extra segments), then git clone failed with a raw non-zero-exit message.

Fix

  • _normalize_clone_url() recognizes GitHub deep-link markers (tree, blob, …)
  • Clones the repository root and emits a clear UserWarning note
  • GitLab subgroups are left unchanged (legitimate path segments)
  • Clone failure messages include the deep-link note when relevant

Tests

  • unit cases for tree/blob strip + GitLab preserve
  • clone_repo argv uses the stripped root (monkeypatched subprocess)

Test plan

  • pytest tests/test_ingest.py -k "deep_link or gitlab or normalize"

Pasted browser URLs like .../tree/main/examples passed validation then
died with a raw git error. Recognize GitHub /tree and /blob suffixes,
clone the repository root, and warn. GitLab subgroup paths stay intact.

Closes alphacrack#109
Copilot AI review requested due to automatic review settings July 23, 2026 00:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

ingest: GitHub deep links (…/tree/main/x) pass URL validation, then die with a raw git error

2 participants