-
Notifications
You must be signed in to change notification settings - Fork 940
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(status): avoid showing components as pending-update when their re…
…mote-lane is empty (#7138) currently, if the remote-lane doesn't exist, or it doesn't have this specific component, it falls back to the either the forked-lane or to the `component.head`. For bit-status or bit-checkout-head this is incorrect. The comparison needs to be against the remote-lane, and if it doesn't exist there, it should assume that the local is ahead.
- Loading branch information
1 parent
9b26590
commit 249e546
Showing
2 changed files
with
58 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,4 +262,26 @@ describe('bit lane command', function () { | |
expect(helper.command.getHead('comp1')).to.equal(secondSnapMain, 'main was not updated'); | ||
}); | ||
}); | ||
describe('import previous version from main when on a lane', () => { | ||
before(() => { | ||
helper.scopeHelper.setNewLocalAndRemoteScopes(); | ||
helper.fixtures.populateComponents(1, false); | ||
helper.command.tagAllWithoutBuild(); | ||
helper.command.tagAllWithoutBuild('--unmodified'); | ||
helper.command.export(); | ||
|
||
helper.scopeHelper.reInitLocalScope(); | ||
helper.scopeHelper.addRemoteScope(); | ||
helper.command.createLane(); | ||
helper.command.importComponent('[email protected]'); | ||
helper.command.snapAllComponentsWithoutBuild('--unmodified'); | ||
}); | ||
// previous bug showed this component in the pending-updates section. | ||
// it was because the calculation whether it's up-to-date was based also on the component-head. | ||
// it should be based on the remote-lane object only. | ||
it('bit status should not show the component as pending-updates because it does not exits on the remote lane', () => { | ||
const status = helper.command.statusJson(); | ||
expect(status.outdatedComponents).to.have.lengthOf(0); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters