Add fully-qualified ref name to Branch
#7473
Labels
tech-debt
Issues and pull requests related to addressing technical debt or improving the codebase
Branch
#7473
A few months ago, we ran into an issue with the branch pruner failing because some of the named refs were ambiguous. The problem turned out to be a tag having the same name as a branch. This ambiguity was the root cause of the errors git was throwing.
The fix involved getting the canonical ref name in the mix so there would be no chance of name conflicts (#6863 (comment)).
Fast forward to today, we have another feature, stashing, that relies on named refs to work properly. Since the ref-name is stored in the custom Desktop stash message, it is very important that Desktop can find these branches unambiguously. At the moment, we are using the short ref name to associate branches with stash entries, but that introduces the same risks we observed in the branch pruner.
I'm propose we update the
Branch
model to include the fully-qualified ref name and use that field for named ref comparisons to rule out the possibility of errors caused by ambiguous refs.FWIW, we are already getting this information, but we don't use it directly in the
Branch
model.desktop/app/src/lib/git/for-each-ref.ts
Lines 24 to 38 in 0fde421
The text was updated successfully, but these errors were encountered: