libgit2 / libgit2/libgit2

git_clone can't parse well for path with double slash

Open
#5,476 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
10.6k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

as the topic, git_clone will parse a local path with double slash truncated from the slash.

Reproduction steps

call git_clone(repo, addr, "/home/kipade//test",attr)
would equal as calling git_clone(repo, url, "/test",attr)

Expected behavior

it should recognize "/home/kipade//test" as "/home/kipade/test"

Actual behavior
Version of libgit2 (release number or SHA1)

current

Operating system(s) tested

linux

In fact, there are many circumstances that the caller would present such a local path with double slash, and most software(bash,and other scripts included) , system api can do well with such a path. I hope libgit2 can do so. thanks.

Contributor guide

Open the contributing guide

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 at the git_clone handling for local repository paths and reproduce the issue on Linux with /home/kipade//test. Trace where the path is truncated, then verify that the full path is preserved as equivalent to /home/kipade/test without changing other clone behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.