-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/development'
- Loading branch information
Showing
11 changed files
with
58 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
import { groupBranches } from '../../src/ui/branches' | ||
import { Branch, BranchType } from '../../src/models/branch' | ||
import { Commit } from '../../src/models/commit' | ||
import { CommitIdentity } from '../../src/models/commit-identity' | ||
|
||
describe('Branches grouping', () => { | ||
const author = new CommitIdentity('Hubot', '[email protected]', new Date()) | ||
|
||
const commit = new Commit( | ||
'300acef', | ||
'300acef', | ||
'summary', | ||
'body', | ||
const branchTip = { | ||
sha: '300acef', | ||
author, | ||
author, | ||
[], | ||
[] | ||
) | ||
} | ||
|
||
const currentBranch = new Branch('master', null, commit, BranchType.Local) | ||
const defaultBranch = new Branch('master', null, commit, BranchType.Local) | ||
const currentBranch = new Branch('master', null, branchTip, BranchType.Local) | ||
const defaultBranch = new Branch('master', null, branchTip, BranchType.Local) | ||
const recentBranches = [ | ||
new Branch('some-recent-branch', null, commit, BranchType.Local), | ||
new Branch('some-recent-branch', null, branchTip, BranchType.Local), | ||
] | ||
const otherBranch = new Branch('other-branch', null, commit, BranchType.Local) | ||
const otherBranch = new Branch( | ||
'other-branch', | ||
null, | ||
branchTip, | ||
BranchType.Local | ||
) | ||
|
||
const allBranches = [currentBranch, ...recentBranches, otherBranch] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import { inferComparisonBranch } from '../../src/lib/stores/helpers/infer-comparison-branch' | ||
import { Branch, BranchType } from '../../src/models/branch' | ||
import { Commit } from '../../src/models/commit' | ||
import { CommitIdentity } from '../../src/models/commit-identity' | ||
import { GitHubRepository } from '../../src/models/github-repository' | ||
import { PullRequest, PullRequestRef } from '../../src/models/pull-request' | ||
|
@@ -9,25 +8,20 @@ import { IRemote } from '../../src/models/remote' | |
import { ComparisonCache } from '../../src/lib/comparison-cache' | ||
import { gitHubRepoFixture } from '../helpers/github-repo-builder' | ||
|
||
function createTestCommit(sha: string) { | ||
return new Commit( | ||
sha, | ||
sha.slice(0, 7), | ||
'', | ||
'', | ||
new CommitIdentity('tester', '[email protected]', new Date()), | ||
new CommitIdentity('tester', '[email protected]', new Date()), | ||
[], | ||
[] | ||
) | ||
} | ||
|
||
function createTestBranch( | ||
name: string, | ||
sha: string, | ||
remote: string | null = null | ||
) { | ||
return new Branch(name, remote, createTestCommit(sha), BranchType.Local) | ||
return new Branch( | ||
name, | ||
remote, | ||
{ | ||
sha, | ||
author: new CommitIdentity('tester', '[email protected]', new Date()), | ||
}, | ||
BranchType.Local | ||
) | ||
} | ||
|
||
function createTestGhRepo( | ||
|