Skip to content

Fix Git::Branch#update_ref #626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 26, 2023
Merged

Fix Git::Branch#update_ref #626

merged 2 commits into from
Feb 26, 2023

Conversation

jcouball
Copy link
Member

@jcouball jcouball commented Feb 26, 2023

Your checklist for this pull request

🚨Please review the guidelines for contributing to this repository.

  • Ensure all commits include DCO sign-off.
  • Ensure that your contributions pass unit testing.
  • Ensure that your contributions contain documentation if applicable.

Description

Fixes #599
Fixes #600

Git::Branch#update_ref creates the wrong ref name, resulting in "refname is ambiguous" warnings. For instance, when updating an existing branch named 'testing' with the following code:

git.branch('testing').update_ref(git.revparse('HEAD'))

Creates a new file .git/testing instead of updating the file .git/refs/heads/testing.

mblythe86 and others added 2 commits February 26, 2023 08:12
Fixes both #599 and #600

Also fixes argument name of update_ref.  I'm assuming it's supposed to be analogous to the command line `git update-ref`, which doesn't directly use a branch name.

Signed-off-by: Matthew Blythe <mblythester+git@gmail.com>
Signed-off-by: James Couball <jcouball@yahoo.com>
@jcouball jcouball merged commit 4409ef2 into master Feb 26, 2023
@jcouball jcouball deleted the fix_branch_update_ref branch February 26, 2023 18:17
This was referenced Feb 26, 2023
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.

Git::Branch private function parse_name doesn't work as documented Git::Branch function update_ref doesn't work as expected
2 participants