libgit2 / libgit2/rugged

Repository#clone_at: unexpected behavior with URL without `.git` ending

Open
#761 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
2.3k
Forks
293
PR merge metrics
No merged PRs in 30d

Description

This problem occurs when authentication parameters are specified in a repository URL.

> url                    = "https://test:token@github.com/company/project.git"
> url_without_git_ending = "https://test:token@github.com/company/project"
>
> Rugged::Repository.clone_at(url_without_git_ending", "/folder", credentials: nil)
Rugged::NetworkError: authentication required but no callback set
	from (irb):11:in `clone_at'
	from (irb):11
	from /usr/bin/irb:11:in `<main>'
> Rugged::Repository.clone_at(url, "/folder", credentials: nil)
=> #<Rugged::Repository:14348060 {path: "/folder"}>

git clone doesn't depend on .git ending.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the two URLs using Rugged::Repository.clone_at and compare authentication handling when the .git suffix is absent. Trace the clone_at entry point to find why credentials are not passed through, then verify that a URL without .git clones successfully with authentication parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, ruby
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.