Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Rework GithubPackage model and promise management #633

Merged
merged 172 commits into from
Apr 20, 2017
Merged
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
e9b883c
(Hopefully) cleaner model and Promise management in GithubPackage
smashwilson Mar 30, 2017
fed769c
Rework unit tests to avoid getInitialModelsPromise()
smashwilson Apr 1, 2017
ec87a16
Merge branch 'master' of github.com:atom/github into aw-single-projec…
smashwilson Apr 5, 2017
909b603
(temporary) console.logstravaganza
smashwilson Apr 5, 2017
bf1cd09
Use an AsyncQueue for model updates
smashwilson Apr 5, 2017
a1d9fca
Use .scheduleActiveModelUpdate()
smashwilson Apr 5, 2017
fc4e678
:fire: last console.log
smashwilson Apr 5, 2017
872f5c0
Introduce a WorkdirContext to bundle workdir-specific models
smashwilson Apr 6, 2017
765bf0e
Repository.destroy() is synchronous
smashwilson Apr 6, 2017
1ec5774
WorkdirContextPool to manage the set of WorkdirContexts
smashwilson Apr 6, 2017
3cbfefb
(remove) :checkered_flag: Windows day :checkered_flag:
smashwilson Apr 7, 2017
129d5e7
Return a null object from the pool when a directory is not present
smashwilson Apr 7, 2017
187ed07
Merge branch 'master' of github.com:atom/github into aw-single-projec…
smashwilson Apr 7, 2017
785386a
Pass a prompt callback to created contexts
smashwilson Apr 7, 2017
f71a932
Restore saved resolution progress state
smashwilson Apr 7, 2017
fe59ecd
Change observers get a synchronous Repository
smashwilson Apr 7, 2017
696585f
Missed one
smashwilson Apr 7, 2017
2740131
Cache working directory lookups
smashwilson Apr 7, 2017
0432866
Clear a pool
smashwilson Apr 7, 2017
7bb3a79
Missed an option in the docs
smashwilson Apr 7, 2017
1b883bd
Rework GitHubPackage to use the WorkdirContext objects
smashwilson Apr 7, 2017
842277f
Merge branch 'aw-single-project-regression' of github.com:atom/github…
smashwilson Apr 10, 2017
49487e9
Handle ENOTDIR when a file path is given
smashwilson Apr 11, 2017
e38e7e6
Resolve other models when repository is null
smashwilson Apr 11, 2017
769de8b
Forward observer and repository events from WorkdirContext
smashwilson Apr 11, 2017
b32a4e2
Forward events from all WorkdirContexts in a pool
smashwilson Apr 11, 2017
3de282c
Pass options to created WorkdirContexts on set()
smashwilson Apr 11, 2017
8571ceb
It's activeContext, not activeWorkdir
smashwilson Apr 11, 2017
d03159f
Subscribe to pool events instead of repository and observer events
smashwilson Apr 11, 2017
993bae3
Remember and use savedState
smashwilson Apr 11, 2017
6eba2ac
Enumerate contextPool, not just activeContext
smashwilson Apr 11, 2017
34b06ff
Add newly initialized and clone repositories to the pool
smashwilson Apr 11, 2017
8694514
Right, I renamed that
smashwilson Apr 11, 2017
6b04880
Getter for cleaner testing
smashwilson Apr 11, 2017
e91ce20
Iron out getNextContext
smashwilson Apr 11, 2017
6ba316e
:fire: unused imports
smashwilson Apr 11, 2017
c318f19
HULK COMMIT GIANT TEST OVERHAUL
smashwilson Apr 11, 2017
3920f34
Merge branch 'master' of github.com:atom/github into aw-single-projec…
smashwilson Apr 11, 2017
bca6016
Import Disposables from event-kit
smashwilson Apr 11, 2017
a740ed4
Create NullWorkdirContexts that track working directory
smashwilson Apr 11, 2017
71dfb8b
Right, I changed the way resolution progress state is passed
smashwilson Apr 11, 2017
dd38b9f
Implement getWorkingDirectory() in FilePatchController
smashwilson Apr 11, 2017
4a7ccf0
Rename activeProjectPath for accuracy
smashwilson Apr 11, 2017
c95a270
untilRepositories() won't wait until the active context is set
smashwilson Apr 11, 2017
bbb6fdc
Wait for Repository creation
smashwilson Apr 11, 2017
03d7471
Replace existing contexts within a pool
smashwilson Apr 11, 2017
5387fd0
Invalidate WorkdirCache entries by subdirectory
smashwilson Apr 11, 2017
6648aa1
Invalidate the workdir cache when an init has been performed
smashwilson Apr 11, 2017
e6db052
Rerender when the Repository loads
smashwilson Apr 11, 2017
b3a324f
Typo fix
smashwilson Apr 11, 2017
9aab04c
Wait until change observers have started
smashwilson Apr 11, 2017
c29ac8c
Set .started *after* watcher has been started
smashwilson Apr 11, 2017
a1d8522
CompositeDisposable.add() no longer supports multiple arguments
smashwilson Apr 11, 2017
9e40126
Initialize disposables in the constructor
smashwilson Apr 11, 2017
b7866ce
Return a Disposable from stubbed method
smashwilson Apr 11, 2017
6bc9714
Fully initialize workspace watchers on Linux
smashwilson Apr 11, 2017
c0f279e
Instrument context changes and full re-renders
smashwilson Apr 11, 2017
7e7419b
Merge branch 'master' into aw-single-project-regression
smashwilson Apr 13, 2017
b883f2e
Merge branch 'master' of github.com:atom/github into aw-single-projec…
smashwilson Apr 13, 2017
e67fe5c
:fire: unused method
smashwilson Apr 12, 2017
5b30c7a
Rework Repository tests in anticipation of the state machine
smashwilson Apr 12, 2017
4a5a6e7
Additional models to return from Repository methods
smashwilson Apr 12, 2017
8cd8c5b
`mkdirs` helper to promisify `fs.mkdirs`
smashwilson Apr 13, 2017
8ff58fa
Test case to verify State delegates
smashwilson Apr 13, 2017
862d60e
`.clone()` takes one argument
smashwilson Apr 13, 2017
be7672d
Delegate ALL THE THINGS to the current State
smashwilson Apr 13, 2017
8e44534
Repository state machine :wrench:
smashwilson Apr 13, 2017
589192c
fetch, push, and pull accept a remote name argument
smashwilson Apr 13, 2017
6b5f832
Move getRemoteForBranchName() into Repository
smashwilson Apr 13, 2017
56d277e
Remote.getNameOr() lets you specify a default
smashwilson Apr 13, 2017
aff481d
saveDiscardHistory() is a native Repository method
smashwilson Apr 13, 2017
d1eb89f
:fire: methods that should no longer be delegated
smashwilson Apr 13, 2017
70bebc3
Use getBlobContents() from git strategy from loadHistoryPayload()
smashwilson Apr 13, 2017
1332c64
Cache invalidation with a fancy decorator
smashwilson Apr 13, 2017
979b815
Refresh explicitly in tests
smashwilson Apr 13, 2017
0d49c45
Model detached Branches
smashwilson Apr 14, 2017
5e07c29
Move URL extraction to Remote
smashwilson Apr 14, 2017
b193c76
Helper to get the SHA of a working directory
smashwilson Apr 14, 2017
c3f3bae
Update buildRepository() for stateful Repositories
smashwilson Apr 14, 2017
258e57f
Detect a Repository's state by name
smashwilson Apr 14, 2017
5afdb22
Delegate a method to respond to filesystem changes
smashwilson Apr 14, 2017
b011471
Adapt to the use of Real Objects for Branches, Remotes, Commits
smashwilson Apr 14, 2017
64843d5
Begin all ResolutionProgress instances empty
smashwilson Apr 14, 2017
a2e01f0
Utility methods on change observers
smashwilson Apr 14, 2017
9f48f95
Register the Destroyed state
smashwilson Apr 14, 2017
9f386d2
Default observeFilesystemChange() to a refresh()
smashwilson Apr 14, 2017
caf499b
WorkdirContext no longer needs to defer state
smashwilson Apr 14, 2017
ef84176
Manage WorkdirContext lifecycle correctly within a pool
smashwilson Apr 14, 2017
d428db3
Introduce an "Absent" state when no working directory is available
smashwilson Apr 14, 2017
30aa5ae
Use nullBranch and nullRemote in defaultProps
smashwilson Apr 17, 2017
5190d63
Async tempdir helper
smashwilson Apr 17, 2017
778183e
Branch and Remote polish
smashwilson Apr 17, 2017
5794042
Return the `transitionTo` result promise
smashwilson Apr 17, 2017
1b3364e
Clear the cache on operation failure too
smashwilson Apr 17, 2017
e75eb35
Return Branch array from getBranches()
smashwilson Apr 17, 2017
fb27202
Delegate `.refresh()` back to Repository
smashwilson Apr 17, 2017
724285d
Make nullWorkdirContext a singleton
smashwilson Apr 17, 2017
a734519
Handle absent Repositories
smashwilson Apr 17, 2017
d575d68
Simplify WorkdirContext tests for synchronous models
smashwilson Apr 17, 2017
dd88f6f
Use the nullWorkdirContext singleton
smashwilson Apr 17, 2017
ea1000b
No need to .rerender() on repository load
smashwilson Apr 17, 2017
b7937fd
:fire: unused Disposable cleanup
smashwilson Apr 17, 2017
51320c7
Clone and init work with empty Repositories
smashwilson Apr 17, 2017
818ea83
Always include project path contexts, even if they are empty
smashwilson Apr 17, 2017
9bcbc98
Switchboard accessor for clarify in tests
smashwilson Apr 17, 2017
3327006
Await the right things in GithubPackage tests
smashwilson Apr 17, 2017
b6dc781
Wait for context to finish updating
smashwilson Apr 17, 2017
a1bffc3
Boolean logic is hard, okay
smashwilson Apr 17, 2017
54d0da7
Await context updates correctly
smashwilson Apr 17, 2017
730b5b3
getTempDir() generates the parent directory itself
smashwilson Apr 18, 2017
72d5f17
DiscardHistory requires a working directory path, not a function
smashwilson Apr 18, 2017
ed69556
Avoid PropTypes warnings by providing null models
smashwilson Apr 18, 2017
76d9c19
Wait for checkout operations to complete
smashwilson Apr 18, 2017
d38a1f7
Merge branch 'master' of github.com:atom/github into aw-go-go-gadget-…
smashwilson Apr 18, 2017
8268a71
Because I changed the behavior of getTempDir for some reason
smashwilson Apr 18, 2017
b23c877
Don't conceal errors
smashwilson Apr 18, 2017
0ea1b57
Always return a Promise from stageFiles and unstageFiles
smashwilson Apr 18, 2017
1b8e85f
Use .refresh() for invalidation to trigger didUpdate
smashwilson Apr 18, 2017
bc70ab9
Await props.commit too
smashwilson Apr 18, 2017
8c5c5fe
:fire: that doesn't need to be a thing any more
smashwilson Apr 18, 2017
6570cdb
Prefer "await asser.async" to the "next render" promises
smashwilson Apr 18, 2017
62cb71b
ResolutionProgress constructor no longer accepts arguments
smashwilson Apr 18, 2017
d270367
PropTypes are our friend
smashwilson Apr 18, 2017
30ec39d
destroy() takes more time on AppVeyor
smashwilson Apr 18, 2017
8b26484
GitPanel :point_right: GitTab for consistency
smashwilson Apr 18, 2017
26b9b5b
:fire: unused imports
smashwilson Apr 18, 2017
4583a18
Default Repository data to null objects
smashwilson Apr 18, 2017
658493e
Always emit an update event on state change
smashwilson Apr 18, 2017
bd9b66e
Hide the Amend checkbox while loading
smashwilson Apr 18, 2017
863d520
Test the CommitView in the loading state
smashwilson Apr 18, 2017
b25433b
Apply .is-loading to the panel when loading
smashwilson Apr 18, 2017
8e8f3dc
Grey out controls and text while loading
smashwilson Apr 18, 2017
94acec7
Undetermined state for package activation delay
smashwilson Apr 19, 2017
c22b6d1
Give Undetermined its own state probe method
smashwilson Apr 19, 2017
6c05e1a
Return absentWorkdirContexts from the pool
smashwilson Apr 19, 2017
adf8d52
Begin with an Undetermined context instead of an Absent one
smashwilson Apr 19, 2017
950c14d
Flatten the State hierarchy
smashwilson Apr 19, 2017
c388a4c
Default implementation of destroy()
smashwilson Apr 19, 2017
0cc01c3
Use behavior probes instead of state probes
smashwilson Apr 19, 2017
7369cac
toString() for debugging handiness
smashwilson Apr 19, 2017
719c15d
Embiggen Undetermined state timeout
smashwilson Apr 19, 2017
ecefa93
Hide branch and push/pull status bar tiles unless a repo is present
smashwilson Apr 19, 2017
bd1fd8e
Merge branch 'master' into aw-single-project-regression
smashwilson Apr 19, 2017
06408fa
:fire: unnecessary etch.updates
smashwilson Apr 19, 2017
6a37990
Merge remote-tracking branch 'origin/aw-single-project-regression' in…
smashwilson Apr 19, 2017
be0ab10
Init dialog
smashwilson Apr 19, 2017
2981190
Render the InitDialog when no working directory is known
smashwilson Apr 19, 2017
076f1d9
createRepositoryForProjectPath() handles paths outside of known projects
smashwilson Apr 19, 2017
4891185
Better errors when attempting to init an existing git repository
smashwilson Apr 19, 2017
c66acdb
Change the init message based on context
smashwilson Apr 19, 2017
9b24ba4
Introduce behavioral variants of the Undetermined state
smashwilson Apr 20, 2017
e7807d3
Create undetermined WorkdirContexts with a behavioral variant
smashwilson Apr 20, 2017
29416d0
Heuristically derive the initial context
smashwilson Apr 20, 2017
0903db0
Pass getLoadSettings to the package
smashwilson Apr 20, 2017
d07e864
Use initialPaths instead of locationsToOpen
smashwilson Apr 20, 2017
bf2b039
Account for renders that occur while fetching Promise data
smashwilson Apr 20, 2017
d639648
Split Undetermined into LoadingGuess and AbsentGuess
smashwilson Apr 20, 2017
46b2aa3
Export state constructors as-is
smashwilson Apr 20, 2017
dbe22c4
Move initial context guess into WorkdirContext
smashwilson Apr 20, 2017
0e57633
Update tests to use static constructor methods
smashwilson Apr 20, 2017
ec61886
Document Repository states
smashwilson Apr 20, 2017
994804d
:fire: unused function
smashwilson Apr 20, 2017
81d8e40
Docs docs docs (without a k)
smashwilson Apr 20, 2017
f2e771f
State transition diagram
smashwilson Apr 20, 2017
311a7c8
Right, no SVGs in markdown renders
smashwilson Apr 20, 2017
170d8cc
It helps if the link is right
smashwilson Apr 20, 2017
5f80ec2
Handle the removal of the last project folder
smashwilson Apr 20, 2017
2080ca4
Merge pull request #654 from atom/aw-go-go-gadget-repository-state-ma…
smashwilson Apr 20, 2017
288c954
File extensions are important in links
smashwilson Apr 20, 2017
473648f
Merge branch 'master' into aw-single-project-regression
smashwilson Apr 20, 2017
8a8f4bd
Avoid recomputing the active item workdir
smashwilson Apr 20, 2017
705ed71
Pass even if the Repository already loaded
smashwilson Apr 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions keymaps/git.cson
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'.workspace':
'ctrl-9': 'github:toggle-git-panel'
'ctrl-(': 'github:toggle-git-panel-focus' # ctrl-shift-9
'ctrl-9': 'github:toggle-git-tab'
'ctrl-(': 'github:toggle-git-tab-focus' # ctrl-shift-9

'.github-Panel':
'cmd-enter': 'github:commit'
4 changes: 2 additions & 2 deletions lib/controllers/commit-view-controller.js
Original file line number Diff line number Diff line change
@@ -71,8 +71,8 @@ export default class CommitViewController {
let message = this.regularCommitMessage;
if (this.props.isAmending) {
message = this.amendingCommitMessage;
if (!message.length && this.props.lastCommit) {
message = this.props.lastCommit.message;
if (!message.length && this.props.lastCommit.isPresent()) {
message = this.props.lastCommit.getMessage();
}
} else if (!message.length && this.props.mergeMessage) {
message = this.props.mergeMessage;
10 changes: 9 additions & 1 deletion lib/controllers/file-patch-controller.js
Original file line number Diff line number Diff line change
@@ -10,7 +10,8 @@ import FilePatchView from '../views/file-patch-view';

export default class FilePatchController extends React.Component {
static propTypes = {
repository: PropTypes.object,
activeWorkingDirectory: PropTypes.string,
repository: PropTypes.object.isRequired,
commandRegistry: PropTypes.object.isRequired,
filePatch: PropTypes.object.isRequired,
stagingStatus: PropTypes.oneOf(['unstaged', 'staged']).isRequired,
@@ -223,6 +224,13 @@ export default class FilePatchController extends React.Component {
return this.props.repository.hasDiscardHistory(this.props.filePatch.getPath());
}

/**
* Used to detect the context when this PaneItem is active
*/
getWorkingDirectory() {
return this.props.activeWorkingDirectory;
}

destroy() {
this.emitter.emit('did-destroy');
}
38 changes: 29 additions & 9 deletions lib/controllers/git-tab-controller.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ import etch from 'etch';

import GitTabView from '../views/git-tab-view';
import ModelObserver from '../models/model-observer';
import {nullBranch} from '../models/branch';
import {nullCommit} from '../models/commit';
import {autobind} from 'core-decorators';
import yubikiri from 'yubikiri';

@@ -18,7 +20,7 @@ export default class GitTabController {
fetchData: this.fetchRepositoryData,
didUpdate: () => {
this.refreshResolutionProgress(false, false);
return etch.update(this);
return this.update();
},
});
this.repositoryObserver.setActiveModel(props.repository);
@@ -32,11 +34,11 @@ export default class GitTabController {
}

render() {
const modelData = this.repositoryObserver.getActiveModelData() || {fetchInProgress: true};
const modelData = this.repositoryObserver.getActiveModelData() || this.defaultRepositoryData();
const hasUndoHistory = this.props.repository ? this.hasUndoHistory() : false;
return (
<GitTabView
ref="gitPanel"
ref="gitTab"
{...modelData}
repository={this.props.repository}
resolutionProgress={this.props.resolutionProgress}
@@ -133,9 +135,25 @@ export default class GitTabController {
const isMerging = await query.isMerging;
return isMerging ? repository.getMergeMessage() : null;
},
fetchInProgress: Promise.resolve(false),
});
}

defaultRepositoryData() {
return {
lastCommit: nullCommit,
isMerging: false,
isRebasing: false,
currentBranch: nullBranch,
unstagedChanges: [],
stagedChanges: [],
mergeConflicts: [],
workingDirectoryPath: this.props.repository.getWorkingDirectoryPath(),
mergeMessage: null,
fetchInProgress: true,
};
}

fetchStagedChanges(repository) {
if (this.props.isAmending) {
return repository.getStagedChangesSinceParentCommit();
@@ -190,7 +208,7 @@ export default class GitTabController {

this.stagingOperationInProgress = true;

const fileListUpdatePromise = this.refs.gitPanel.refs.stagingView.getNextListUpdatePromise();
const fileListUpdatePromise = this.refs.gitTab.refs.stagingView.getNextListUpdatePromise();
let stageOperationPromise;
if (stageStatus === 'staged') {
stageOperationPromise = this.unstageFiles(filePaths);
@@ -233,7 +251,7 @@ export default class GitTabController {

@autobind
async prepareToCommit() {
return !await this.props.ensureGitPanel();
return !await this.props.ensureGitTab();
}

@autobind
@@ -275,6 +293,8 @@ export default class GitTabController {
`Cannot abort because ${e.path} is both dirty and staged.`,
{dismissable: true},
);
} else {
throw e;
}
}
return etch.update(this);
@@ -308,20 +328,20 @@ export default class GitTabController {
}

focus() {
this.refs.gitPanel.focus();
this.refs.gitTab.focus();
}

focusAndSelectStagingItem(filePath, stagingStatus) {
return this.refs.gitPanel.focusAndSelectStagingItem(filePath, stagingStatus);
return this.refs.gitTab.focusAndSelectStagingItem(filePath, stagingStatus);
}

isFocused() {
return this.refs.gitPanel.isFocused();
return this.refs.gitTab.isFocused();
}

@autobind
quietlySelectItem(filePath, stagingStatus) {
return this.refs.gitPanel.quitelySelectItem(filePath, stagingStatus);
return this.refs.gitTab.quitelySelectItem(filePath, stagingStatus);
}

@autobind
24 changes: 10 additions & 14 deletions lib/controllers/github-tab-controller.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ import {autobind} from 'core-decorators';
import yubikiri from 'yubikiri';

import RemotePrController from './remote-pr-controller';
import Repository from '../models/repository';
import GithubLoginModel from '../models/github-login-model';
import ObserveModel from '../views/observe-model';
import {RemotePropType} from '../prop-types';
@@ -27,9 +26,9 @@ class RemoteSelector extends React.Component {
</p>
<ul>
{remotes.map(remote => (
<li key={remote.name}>
<li key={remote.getName()}>
<a href="#" onClick={e => selectRemote(e, remote)}>
{remote.name} ({remote.info.owner}/{remote.info.name})
{remote.getName()} ({remote.getOwner()}/{remote.getRepo()})
</a>
</li>
))}
@@ -51,12 +50,9 @@ export default class GithubTabController extends React.Component {

fetchModelData(repo) {
return yubikiri({
remotes: repo.getRemotes().then(remotes => {
return remotes.map(({name, url}) => ({name, url, info: Repository.githubInfoFromRemote(url)}))
.filter(remote => remote.info.githubRepo);
}),
remotes: repo.getRemotes().then(remotes => remotes.filter(remote => remote.isGithubRepo())),
currentBranch: repo.getCurrentBranch(),
selectedRemote: repo.getConfig('atomGithub.currentRemote'),
selectedRemoteName: repo.getConfig('atomGithub.currentRemote'),
});
}

@@ -75,15 +71,15 @@ export default class GithubTabController extends React.Component {
}

renderWithData({remotes, currentBranch, selectedRemote}) {
if (!this.props.repository || !remotes) {
if (!this.props.repository.isPresent() || !remotes) {
return null;
}

if (!currentBranch || currentBranch.isDetached) {
if (!currentBranch.isPresent() || currentBranch.isDetached()) {
return null;
}

let remote = remotes.find(r => r.name === selectedRemote);
let remote = remotes.find(r => r.getName() === selectedRemote);
let manyRemotesAvailable = false;
if (!remote && remotes.length === 1) {
remote = remotes[0];
@@ -100,13 +96,13 @@ export default class GithubTabController extends React.Component {
host="https://api.github.com"
loginModel={this.loginModel}
remote={remote}
currentBranchName={currentBranch.name}
currentBranchName={currentBranch.getName()}
/>
}
{!remote && manyRemotesAvailable &&
<RemoteSelector
remotes={remotes}
currentBranchName={currentBranch.name}
currentBranchName={currentBranch.getName()}
selectRemote={this.handleRemoteSelect}
/>
}
@@ -147,6 +143,6 @@ export default class GithubTabController extends React.Component {
@autobind
handleRemoteSelect(e, remote) {
e.preventDefault();
this.props.repository.setConfig('atomGithub.currentRemote', remote.name);
this.props.repository.setConfig('atomGithub.currentRemote', remote.getName());
}
}
6 changes: 3 additions & 3 deletions lib/controllers/pr-info-controller.js
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ export default class PrInfoController extends React.Component {
shouldComponentUpdate(nextProps) {
return (
nextProps.token !== this.props.token ||
nextProps.hsot !== this.props.host ||
nextProps.host !== this.props.host ||
nextProps.currentBranchName !== this.props.currentBranchName ||
nextProps.onLogin !== this.props.onLogin ||
nextProps.remote !== this.props.remote
@@ -39,8 +39,8 @@ export default class PrInfoController extends React.Component {
}

const route = new PrInfoByBranchRoute({
repoOwner: this.props.remote.info.owner,
repoName: this.props.remote.info.name,
repoOwner: this.props.remote.getOwner(),
repoName: this.props.remote.getName(),
branchName: this.props.currentBranchName,
});

2 changes: 2 additions & 0 deletions lib/controllers/remote-pr-controller.js
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import {RemotePropType} from '../prop-types';
import ObserveModelDecorator from '../decorators/observe-model';
import GithubLoginView from '../views/github-login-view';
import {UNAUTHENTICATED} from '../models/github-login-model';
import {nullRemote} from '../models/remote';
import PrInfoController from './pr-info-controller';

@ObserveModelDecorator({
@@ -31,6 +32,7 @@ export default class RemotePrController extends React.Component {

static defaultProps = {
host: 'https://api.github.com',
remote: nullRemote,
token: null,
}

10 changes: 4 additions & 6 deletions lib/controllers/repository-conflict-controller.js
Original file line number Diff line number Diff line change
@@ -25,16 +25,15 @@ export default class RepositoryConflictController extends React.Component {
static propTypes = {
workspace: PropTypes.object.isRequired,
commandRegistry: PropTypes.object.isRequired,
resolutionProgress: PropTypes.object,
repository: PropTypes.object,
workingDirectoryPath: PropTypes.string,
resolutionProgress: PropTypes.object.isRequired,
repository: PropTypes.object.isRequired,
mergeConflictPaths: PropTypes.arrayOf(PropTypes.string),
isRebasing: PropTypes.bool,
refreshResolutionProgress: PropTypes.func,
};

static defaultProps = {
resolutionProgress: ResolutionProgress.empty(),
resolutionProgress: new ResolutionProgress(),
mergeConflictPaths: [],
isRebasing: false,
refreshResolutionProgress: () => {},
@@ -76,14 +75,13 @@ export default class RepositoryConflictController extends React.Component {

getConflictingEditors() {
if (
!this.props.workingDirectoryPath ||
this.props.mergeConflictPaths.length === 0 ||
this.state.openEditors.length === 0
) {
return [];
}

const commonBasePath = this.props.workingDirectoryPath;
const commonBasePath = this.props.repository.getWorkingDirectoryPath();
const fullMergeConflictPaths = new Set(
this.props.mergeConflictPaths.map(relativePath => path.join(commonBasePath, relativePath)),
);
Loading