- Notifications
You must be signed in to change notification settings - Fork535
Open
Description
Subject of the issue
Given I clone a git repository using git on my local machine, so without this lib, theremote.origin.fetch
targets+refs/heads/*:refs/remotes/origin/*
while when I clone the same repo but with this lib the theremote.origin.fetch
targets+refs/heads/master:refs/remotes/origin/master
.
This makes thefetch
method not being able to retrieve other branches references and therefore thereset_hard
method to fail with:
fatal: ambiguous argument 'origin/8-missing-reference-language-translation-files-in-yml': unknown revision or path not in the working tree.
Your environment
- version of git:
2.32.6
- version of ruby-git:
1.18.0
- version of ruby:
2.7.6
Steps to reproduce
git=Git.clone(URL,destination)# Supposed to retrieve all the remote branch refs, but is notgit.remote(Git::GIT_REMOTE_NAME).fetch# Switches to the desired branchgit.branch('8-missing-reference-language-translation-files-in-yml').checkout# Here we want to be fully aligned with the remote branchgit.reset_hard("#{Git::GIT_REMOTE_NAME}/8-missing-reference-language-translation-files-in-yml")#=> fatal: ambiguous argument 'origin/8-missing-reference-language-translation-files-in-yml': unknown revision or path not in the working tree.
Expected behaviour
Theremote.origin.fetch
should be changed from:
remote.origin.fetch=+refs/heads/master:refs/remotes/origin/master
to:
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
Actual behaviour
See "Steps to reproduce"
Metadata
Metadata
Assignees
Labels
No labels