Skip to content

Commit d88e04e

Browse files
devvaannshabose
authored andcommitted
fix: git markers disappearing from tabs when files are staged
1 parent 84170f2 commit d88e04e

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/extensions/default/Git/src/TabBarIntegration.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ define(function (require) {
2828
if (!status) {
2929
return false;
3030
}
31-
return (
32-
status.some(
33-
(statusType) =>
34-
statusType === Git.FILE_STATUS.MODIFIED ||
35-
statusType === Git.FILE_STATUS.RENAMED ||
36-
statusType === Git.FILE_STATUS.COPIED
37-
) && !status.includes(Git.FILE_STATUS.STAGED)
31+
return status.some(
32+
(statusType) =>
33+
statusType === Git.FILE_STATUS.MODIFIED ||
34+
statusType === Git.FILE_STATUS.RENAMED ||
35+
statusType === Git.FILE_STATUS.COPIED
3836
);
3937
}
4038

@@ -50,7 +48,11 @@ define(function (require) {
5048
return false;
5149
}
5250

53-
return status.includes(Git.FILE_STATUS.UNTRACKED);
51+
// return true if it's untracked or if it's newly added (which means it was untracked before staging)
52+
return (
53+
status.includes(Git.FILE_STATUS.UNTRACKED) ||
54+
(status.includes(Git.FILE_STATUS.ADDED) && status.includes(Git.FILE_STATUS.STAGED))
55+
);
5456
}
5557

5658

src/extensionsIntegrated/TabBar/main.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ define(function (require, exports, module) {
133133

134134
let gitStatus = ""; // this will be shown in the tooltip when a tab is hovered
135135
let gitStatusClass = ""; // for styling
136-
let gitStatusLetter = ""; // shown in the tab, either U or M
137136

138137
if (window.phoenixGitEvents && window.phoenixGitEvents.TabBarIntegration) {
139138
const TabBarIntegration = window.phoenixGitEvents.TabBarIntegration;
@@ -144,11 +143,9 @@ define(function (require, exports, module) {
144143
if (TabBarIntegration.isUntracked(entry.path)) {
145144
gitStatus = "Untracked";
146145
gitStatusClass = "git-new";
147-
gitStatusLetter = "U";
148146
} else if (TabBarIntegration.isModified(entry.path)) {
149147
gitStatus = "Modified";
150148
gitStatusClass = "git-modified";
151-
gitStatusLetter = "M";
152149
}
153150
}
154151

0 commit comments

Comments
 (0)