Browse Source

Removes unused branch

main
Eric Amodio 7 years ago
parent
commit
334931da83
4 changed files with 10 additions and 13 deletions
  1. +2
    -3
      src/views/commitFileNode.ts
  2. +2
    -2
      src/views/commitNode.ts
  3. +3
    -4
      src/views/statusFileCommitsNode.ts
  4. +3
    -4
      src/views/statusFilesNode.ts

+ 2
- 3
src/views/commitFileNode.ts View File

@ -3,7 +3,7 @@ import { Command, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Commands, DiffWithPreviousCommandArgs } from '../commands';
import { GravatarDefault } from '../configuration';
import { Explorer, ExplorerNode, ResourceType } from './explorerNode';
import { CommitFormatter, getGitStatusIcon, GitBranch, GitLogCommit, GitUri, ICommitFormatOptions, IGitStatusFile, IStatusFormatOptions, StatusFileFormatter } from '../gitService';
import { CommitFormatter, getGitStatusIcon, GitLogCommit, GitUri, ICommitFormatOptions, IGitStatusFile, IStatusFormatOptions, StatusFileFormatter } from '../gitService';
import * as path from 'path';
export enum CommitFileNodeDisplayAs {
@ -26,8 +26,7 @@ export class CommitFileNode extends ExplorerNode {
public readonly status: IGitStatusFile,
public commit: GitLogCommit,
protected readonly explorer: Explorer,
private displayAs: CommitFileNodeDisplayAs,
public readonly branch?: GitBranch
private displayAs: CommitFileNodeDisplayAs
) {
super(GitUri.fromFileStatus(status, commit.repoPath, commit.sha));
this.repoPath = commit.repoPath;

+ 2
- 2
src/views/commitNode.ts View File

@ -14,7 +14,7 @@ export class CommitNode extends ExplorerRefNode {
constructor(
public readonly commit: GitLogCommit,
private readonly explorer: Explorer,
public readonly branch?: GitBranch
private readonly branch?: GitBranch
) {
super(commit.toGitUri());
}
@ -33,7 +33,7 @@ export class CommitNode extends ExplorerRefNode {
if (commit === undefined) return [];
let children: IFileExplorerNode[] = [
...Iterables.map(commit.fileStatuses, s => new CommitFileNode(s, commit.toFileCommit(s), this.explorer, CommitFileNodeDisplayAs.File, this.branch))
...Iterables.map(commit.fileStatuses, s => new CommitFileNode(s, commit.toFileCommit(s), this.explorer, CommitFileNodeDisplayAs.File))
];
if (this.explorer.config.files.layout !== ExplorerFilesLayout.List) {

+ 3
- 4
src/views/statusFileCommitsNode.ts View File

@ -3,7 +3,7 @@ import { Command, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Commands, DiffWithPreviousCommandArgs } from '../commands';
import { CommitFileNode, CommitFileNodeDisplayAs } from './commitFileNode';
import { Explorer, ExplorerNode, ResourceType } from './explorerNode';
import { getGitStatusIcon, GitBranch, GitLogCommit, GitUri, IGitStatusFile, IGitStatusFileWithCommit, IStatusFormatOptions, StatusFileFormatter } from '../gitService';
import { getGitStatusIcon, GitLogCommit, GitUri, IGitStatusFile, IGitStatusFileWithCommit, IStatusFormatOptions, StatusFileFormatter } from '../gitService';
import * as path from 'path';
export class StatusFileCommitsNode extends ExplorerNode {
@ -12,14 +12,13 @@ export class StatusFileCommitsNode extends ExplorerNode {
public readonly repoPath: string,
public readonly status: IGitStatusFile,
public readonly commits: GitLogCommit[],
private readonly explorer: Explorer,
public readonly branch?: GitBranch
private readonly explorer: Explorer
) {
super(GitUri.fromFileStatus(status, repoPath, 'HEAD'));
}
async getChildren(): Promise<ExplorerNode[]> {
return this.commits.map(c => new CommitFileNode(this.status, c, this.explorer, CommitFileNodeDisplayAs.CommitLabel | (this.explorer.config.gravatars ? CommitFileNodeDisplayAs.Gravatar : CommitFileNodeDisplayAs.CommitIcon), this.branch));
return this.commits.map(c => new CommitFileNode(this.status, c, this.explorer, CommitFileNodeDisplayAs.CommitLabel | (this.explorer.config.gravatars ? CommitFileNodeDisplayAs.Gravatar : CommitFileNodeDisplayAs.CommitIcon)));
}
async getTreeItem(): Promise<TreeItem> {

+ 3
- 4
src/views/statusFilesNode.ts View File

@ -5,7 +5,7 @@ import { ExplorerFilesLayout } from '../configuration';
import { ExplorerNode, ResourceType, ShowAllNode } from './explorerNode';
import { FolderNode, IFileExplorerNode } from './folderNode';
import { GitExplorer } from './gitExplorer';
import { GitBranch, GitCommitType, GitLog, GitLogCommit, GitService, GitStatus, GitUri, IGitStatusFileWithCommit } from '../gitService';
import { GitCommitType, GitLog, GitLogCommit, GitService, GitStatus, GitUri, IGitStatusFileWithCommit } from '../gitService';
import { StatusFileCommitsNode } from './statusFileCommitsNode';
import * as path from 'path';
@ -17,8 +17,7 @@ export class StatusFilesNode extends ExplorerNode {
constructor(
public readonly status: GitStatus,
public readonly range: string | undefined,
private readonly explorer: GitExplorer,
public readonly branch?: GitBranch
private readonly explorer: GitExplorer
) {
super(GitUri.fromRepoPath(status.repoPath));
this.repoPath = status.repoPath;
@ -87,7 +86,7 @@ export class StatusFilesNode extends ExplorerNode {
const groups = Arrays.groupBy(statuses, s => s.fileName);
let children: IFileExplorerNode[] = [
...Iterables.map(Objects.values(groups), statuses => new StatusFileCommitsNode(repoPath, statuses[statuses.length - 1], statuses.map(s => s.commit), this.explorer, this.branch))
...Iterables.map(Objects.values(groups), statuses => new StatusFileCommitsNode(repoPath, statuses[statuses.length - 1], statuses.map(s => s.commit), this.explorer))
];
if (this.explorer.config.files.layout !== ExplorerFilesLayout.List) {

Loading…
Cancel
Save