!21542 Part 2: Call openPendingTab only if the open file has change
What does this MR do?
Once !21676 (merged) is merged, it is possible that staging a file doesn't actually add a file to staged. Likewise unstaging a file might not add it to unstaged files. In terms of git, this happens when the staged and unstaged content are exactly the same but opposite. For example, adding a word "hello" in staged and removing the same word in unstaged.
Once this behaviour is introduced in !21676 (merged), the following four actions may produce console errors and therefore break the editor as a result of trying to search for open file in staged/unstaged changes and calling openPendingFile
action on it:
stageAllChanges
unstageAllChanges
stageChange
unstageChange
This MR is the second part of the breakdown of MR !21542 (closed). The code in this MR technically doesn't depend on !21676 (merged), but it has two integration tests that will fail unless !21676 (merged) is merged.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team