diff --git a/keymaps/git.cson b/keymaps/git.cson index 81abdfa803..98e30a2427 100644 --- a/keymaps/git.cson +++ b/keymaps/git.cson @@ -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' diff --git a/lib/controllers/commit-view-controller.js b/lib/controllers/commit-view-controller.js index 5d63054aa2..e75762f698 100644 --- a/lib/controllers/commit-view-controller.js +++ b/lib/controllers/commit-view-controller.js @@ -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; diff --git a/lib/controllers/file-patch-controller.js b/lib/controllers/file-patch-controller.js index d8abe05648..2722869510 100644 --- a/lib/controllers/file-patch-controller.js +++ b/lib/controllers/file-patch-controller.js @@ -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'); } diff --git a/lib/controllers/git-tab-controller.js b/lib/controllers/git-tab-controller.js index 96e30e5a28..6f043a970a 100644 --- a/lib/controllers/git-tab-controller.js +++ b/lib/controllers/git-tab-controller.js @@ -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 (