"Associated revisions" doesn't clean up duplicates

Added by Igor Pellegrini about 4 years ago

I usually refer Redmine issues in my commit messages, via refs #<issue-number>.

The problem is that Redmine will show duplicated commits when using git rebase --onto master feature_branch.
Of course git rebase duplicates the commit so that the one on master (commitB) will have a different SHA from the original feature_branch commit (commitA); Redmine cannot know that they are the same commit so it show reference to both of them inside the issue.

BUT even after deleting the feature_branch (so that the source commit could become unreachable and detached, hence to be ignored) the issue still references the source commit (commitA) AND the rebased commit (commitB) resulting in an ugly/confusing duplication (and actually commitA shouldn't exist anymore).

Is it a bug? Should it be reported? Can I solve in any way acting on my repository?