Skip to content

Commit db77f77

Browse files
fcollonvaltelamonian
authored andcommitted
Improve naming
1 parent 06a934a commit db77f77

File tree

11 files changed

+192
-165
lines changed

11 files changed

+192
-165
lines changed

src/components/BranchHeader.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface IBranchHeaderProps {
2828
model: IGitExtension;
2929
currentBranch: string;
3030
upstreamBranch: string;
31-
stagedFiles: Git.IGitStatusFileResult[];
31+
stagedFiles: Git.IStatusFileResult[];
3232
data: Git.IBranch[];
3333
refresh: () => Promise<void>;
3434
disabled: boolean;
@@ -50,12 +50,15 @@ export class BranchHeader extends React.Component<
5050

5151
/** Switch current working branch */
5252
async switchBranch(branchName: string) {
53-
await this.props.model.checkout(true, false, branchName, false, null);
53+
await this.props.model.checkout({ branchname: branchName });
5454
this.toggleSelect();
5555
}
5656

5757
createNewBranch = async (branchName: string) => {
58-
await this.props.model.checkout(true, true, branchName, false, null);
58+
await this.props.model.checkout({
59+
newBranch: true,
60+
branchname: branchName
61+
});
5962
this.toggleNewBranchBox();
6063
};
6164

src/components/FileItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { openDiffView } from './diff/DiffWidget';
3737
import { ISpecialRef } from './diff/model';
3838

3939
export interface IFileItemProps {
40-
file: Git.IGitStatusFileResult;
40+
file: Git.IStatusFileResult;
4141
stage: string;
4242
model: GitExtension;
4343
moveFile: (file: string) => Promise<void>;

src/components/FileList.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ export interface IFileListState {
5151
}
5252

5353
export interface IFileListProps {
54-
stagedFiles: Git.IGitStatusFileResult[];
55-
unstagedFiles: Git.IGitStatusFileResult[];
56-
untrackedFiles: Git.IGitStatusFileResult[];
54+
stagedFiles: Git.IStatusFileResult[];
55+
unstagedFiles: Git.IStatusFileResult[];
56+
untrackedFiles: Git.IStatusFileResult[];
5757
model: GitExtension;
5858
renderMime: IRenderMimeRegistry;
5959
}
@@ -302,23 +302,23 @@ export class FileList extends React.Component<IFileListProps, IFileListState> {
302302

303303
/** Reset all staged files */
304304
resetAllStagedFiles = async () => {
305-
await this.props.model.reset(true, null);
305+
await this.props.model.reset();
306306
};
307307

308308
/** Reset a specific staged file */
309309
resetStagedFile = async (file: string) => {
310-
await this.props.model.reset(false, file);
310+
await this.props.model.reset(file);
311311
};
312312

313313
/** Add all unstaged files */
314314
addAllUnstagedFiles = async () => {
315-
await this.props.model.add(true, null);
315+
await this.props.model.add();
316316
};
317317

318318
/** Discard changes in all unstaged files */
319319
discardAllUnstagedFiles = async () => {
320320
try {
321-
await this.props.model.checkout(false, false, null, true, null);
321+
await this.props.model.checkout();
322322
} catch (reason) {
323323
showErrorMessage('Discard all changes failed.', reason, [
324324
Dialog.warnButton({ label: 'DISMISS' })
@@ -328,13 +328,13 @@ export class FileList extends React.Component<IFileListProps, IFileListState> {
328328

329329
/** Add a specific unstaged file */
330330
addUnstagedFile = async (file: string) => {
331-
await this.props.model.add(false, file);
331+
await this.props.model.add(file);
332332
};
333333

334334
/** Discard changes in a specific unstaged file */
335335
discardUnstagedFile = async (file: string) => {
336336
try {
337-
await this.props.model.checkout(false, false, null, false, file);
337+
await this.props.model.checkout({ filename: file });
338338
} catch (reason) {
339339
showErrorMessage(`Discard changes for ${file} failed.`, reason, [
340340
Dialog.warnButton({ label: 'DISMISS' })
@@ -349,7 +349,7 @@ export class FileList extends React.Component<IFileListProps, IFileListState> {
349349

350350
/** Add a specific untracked file */
351351
addUntrackedFile = async (file: string) => {
352-
await this.props.model.add(false, file);
352+
await this.props.model.add(file);
353353
};
354354

355355
disableStagesForDiscardAll = () => {

src/components/GitPanel.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export interface IGitSessionNodeState {
2323

2424
pastCommits: Git.ISingleCommitInfo[];
2525

26-
stagedFiles: Git.IGitStatusFileResult[];
27-
unstagedFiles: Git.IGitStatusFileResult[];
28-
untrackedFiles: Git.IGitStatusFileResult[];
26+
stagedFiles: Git.IStatusFileResult[];
27+
unstagedFiles: Git.IStatusFileResult[];
28+
untrackedFiles: Git.IStatusFileResult[];
2929
hasChangedFiles: boolean;
3030

3131
isHistoryVisible: boolean;
@@ -124,9 +124,9 @@ export class GitPanel extends React.Component<
124124
setStatus = () => {
125125
if (this.props.model.pathRepository !== null) {
126126
// Get git status for current branch
127-
let stagedFiles = new Array<Git.IGitStatusFileResult>();
128-
let unstagedFiles = new Array<Git.IGitStatusFileResult>();
129-
let untrackedFiles = new Array<Git.IGitStatusFileResult>();
127+
let stagedFiles = new Array<Git.IStatusFileResult>();
128+
let unstagedFiles = new Array<Git.IStatusFileResult>();
129+
let untrackedFiles = new Array<Git.IStatusFileResult>();
130130
let changedFiles = 0;
131131
let statusFiles = this.props.model.status;
132132
if (statusFiles.length > 0) {

src/components/GitStage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { FileItem } from './FileItem';
1919

2020
export interface IGitStageProps {
2121
heading: string;
22-
files: Git.IGitStatusFileResult[];
22+
files: Git.IStatusFileResult[];
2323
model: GitExtension;
2424
showFiles: boolean;
2525
displayFiles: () => void;
@@ -143,7 +143,7 @@ export class GitStage extends React.Component<IGitStageProps, IGitStageState> {
143143
{this.props.showFiles && (
144144
<ul className={sectionFileContainerStyle}>
145145
{this.props.files.map(
146-
(file: Git.IGitStatusFileResult, fileIndex: number) => {
146+
(file: Git.IStatusFileResult, fileIndex: number) => {
147147
return (
148148
<FileItem
149149
key={fileIndex}

0 commit comments

Comments
 (0)