Skip to content

merging branch when tag with same name exists #1873

@Deeem2031

Description

@Deeem2031
  1. Fork 1.83.1.0
  2. create tag "test"
  3. create branch "test" and add at least one commit to it
  4. try to merge the branch "test" with default merge option

expected

fork merges commits of the branch

observed

nothing, at least that's what seems to happen at first. The merge window closes and you get no changes. What does happen in the background is fork merges the tag which is at the same commit thus creating no changes.

references

I found this behavior referenced in issue 570

In order to solve conflict with same named branch and tag, we replaced git merge branch with git merge /refs/heads/branch.

Also kind of similar is Issue 744: Cannot apply stash when there is branch "stash"

ideas

As the comment in 570 suggests it can't be fixed with fully qualifying all branches without sacrificing proper merge messages. Maybe only fully qualify the name when there is ambiguity (dunno if there is a way to detect that in advance) or at least show the warning the git command does output (warning: refname 'test' is ambiguous.) and inform the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions