libgit2 / libgit2/rugged

Rugged::Repository#clone_at :upstream option has no effect

Open
#970 2 comments 0 reactions 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

According to docs

:remote
The name to give to the “origin” remote. Defaults to "origin".

But doesn't produce any results. I've tested this with rugged 1.4.4, 1.5.3, 1.6.3 and 1.7.1:

require 'rugged'
Rugged::Repository.clone_at('../repo', 'fork', remote: 'upstream')
git -C fork remote -v
origin ../repo (fetch)
origin ../repo (push)

Shouldn't "origin" be named "upstream"? I would expect it to work like git clone --origin upstream ../repo fork

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 at Rugged::Repository.clone_at and trace how its :remote option is handled, using the reproduction in the issue as the baseline. Compare the resulting remote name from git -C fork remote -v with git clone --origin upstream; done means the requested remote name is honored instead of always producing origin.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, ruby
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.