Skip to content

Commit c67ebe1

Browse files
navn-rfcollonval
andcommitted
Apply suggestions from code review
Improve readability Co-authored-by: Frédéric Collonval <[email protected]>
1 parent f5292c5 commit c67ebe1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/HistorySideBar.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,13 @@ export const HistorySideBar: React.FunctionComponent<IHistorySideBarProps> = (
112112
const uncommitted = React.useMemo<Git.ISingleCommitInfo>(() => {
113113
return {
114114
author: props.trans.__('You'),
115-
// INDEX or WORKING special ref
116-
commit: `${+(props.model.selectedHistoryFile?.status === 'staged')}`,
115+
commit: `${
116+
props.model.selectedHistoryFile?.status === 'staged'
117+
? Git.Diff.SpecialRef.INDEX
118+
: Git.Diff.SpecialRef.WORKING
119+
}`,
117120
pre_commit: 'HEAD',
118-
is_binary: !!props.commits[0]?.is_binary,
121+
is_binary: props.commits[0]?.is_binary ?? false,
119122
commit_msg: props.trans.__('Uncommitted Changes'),
120123
date: props.trans.__('now')
121124
};

0 commit comments

Comments
 (0)