Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Maintain unified alt src invariant on atom select
Browse files Browse the repository at this point in the history
  • Loading branch information
sdboyer committed Aug 9, 2017
1 parent 72cc0d9 commit 21e8fd1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/gps/solver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,15 @@ func (s *solver) selectAtom(a atomWithPackages, pkgonly bool) {
}

if len(newp) > 0 {
// If there was a previously-established alternate source for this dependency,
// but the current atom did not express one (and getting here means passed the source
// hot-swapping rules - see checkIdentMatches()), then we have to create the new bmi
// with the alternate source. Otherwise, we end up with two discrete
// project entries for the project root in the final output, one with
// the alternate source, and one without. See #969.
id, _ := s.sel.getIdentFor(dep.Ident.ProjectRoot)
bmi := bimodalIdentifier{
id: dep.Ident,
id: id,
pl: newp,
// This puts in a preferred version if one's in the map, else
// drops in the zero value (nil)
Expand Down

0 comments on commit 21e8fd1

Please sign in to comment.