Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"chai-assert-async",
"transform-object-rest-spread",
"transform-es2015-modules-commonjs",
"transform-async-to-generator",
"transform-decorators-legacy", // must come before class-properties
"transform-class-properties",
"transform-es2015-destructuring", // https://github.com/babel/babel/issues/4074
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"atom"
]
},
"extends": ["fbjs/opensource"],
"extends": ["fbjs-opensource"],
"rules": {
"linebreak-style": 0,
"no-param-reassign": 0,
Expand Down
1 change: 1 addition & 0 deletions assert-messages-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = function({types: t}) {
if (!t.isMemberExpression(callee)) { return; }

if (!t.isIdentifier(callee.object, {name: 'assert'})) { return; }
if (t.isIdentifier(callee.property, {name: 'isRejected'})) { return; }
if (!t.isIdentifier(callee.property)) { return; }

try {
Expand Down
8 changes: 4 additions & 4 deletions lib/containers/issueish-pane-item-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ export class IssueishPaneItemView extends React.Component {
<div className="reactions">
{issueish.reactionGroups.map(group => (
group.users.totalCount > 0
? <span className={cx('reaction-group', group.content.toLowerCase())} key={group.content}>
{reactionTypeToEmoji[group.content]} &nbsp; {group.users.totalCount}
</span>
: null
? <span className={cx('reaction-group', group.content.toLowerCase())} key={group.content}>
{reactionTypeToEmoji[group.content]} &nbsp; {group.users.totalCount}
</span>
: null
))}
</div>
{isPr ?
Expand Down
8 changes: 4 additions & 4 deletions lib/containers/pr-info-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ export class PrInfo extends React.Component {
<div className="reactions">
{pr.reactionGroups.map(group => (
group.users.totalCount > 0
? <span className={cx('reaction-group', group.content.toLowerCase())} key={group.content}>
{reactionTypeToEmoji[group.content]} &nbsp; {group.users.totalCount}
</span>
: null
? <span className={cx('reaction-group', group.content.toLowerCase())} key={group.content}>
{reactionTypeToEmoji[group.content]} &nbsp; {group.users.totalCount}
</span>
: null
))}
</div>
<PrStatusesContainer pullRequest={pr} />
Expand Down
12 changes: 6 additions & 6 deletions lib/controllers/file-patch-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ export default class FilePatchController extends React.Component {
{oldMode: fp.getOldMode(), newMode: fp.getNewMode()} :
null;
const symlinkChange = fp && fp.hasSymlink() ?
{
oldSymlink: fp.getOldSymlink(),
newSymlink: fp.getNewSymlink(),
typechange: fp.hasTypechange(),
filePatchStatus: fp.getStatus(),
} : null;
{
oldSymlink: fp.getOldSymlink(),
newSymlink: fp.getNewSymlink(),
typechange: fp.hasTypechange(),
filePatchStatus: fp.getStatus(),
} : null;
const repository = this.repositoryObserver.getActiveModel();
if (repository.isUndetermined() || repository.isLoading()) {
return (
Expand Down
21 changes: 11 additions & 10 deletions lib/controllers/remote-pr-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,17 @@ export default class RemotePrController extends React.Component {

return (
<div className="github-RemotePrController">
{token && token !== UNAUTHENTICATED && <PrInfoController
{...{
host, remote, branches, token, loginModel, selectedPrUrl,
aheadCount, pushInProgress, onSelectPr, onUnpinPr,
}}
onLogin={this.handleLogin}
onLogout={this.handleLogout}
onCreatePr={this.handleCreatePr}
/>
}
{token && token !== UNAUTHENTICATED &&
<PrInfoController
{...{
host, remote, branches, token, loginModel, selectedPrUrl,
aheadCount, pushInProgress, onSelectPr, onUnpinPr,
}}
onLogin={this.handleLogin}
onLogout={this.handleLogout}
onCreatePr={this.handleCreatePr}
/>
}
{(!token || token === UNAUTHENTICATED) && <GithubLoginView onLogin={this.handleLogin} />}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion lib/controllers/root-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default class RootController extends React.Component {
discardLines={this.discardLines}
undoLastDiscard={this.undoLastDiscard}
/>
)}
)}
</PaneItem>
<PaneItem workspace={this.props.workspace} uriPattern={IssueishPaneItem.uriPattern}>
{({itemHolder, params, uri}) => (
Expand Down
8 changes: 4 additions & 4 deletions lib/github-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const defaultState = {

export default class GithubPackage {
constructor(workspace, project, commandRegistry, notificationManager, tooltips, styles, grammars, confirm, config,
deserializers, configDirPath, getLoadSettings) {
deserializers, configDirPath, getLoadSettings) {
this.workspace = workspace;
this.project = project;
this.commandRegistry = commandRegistry;
Expand Down Expand Up @@ -322,9 +322,9 @@ export default class GithubPackage {
createDockItemStub({uri}) {
let item;
switch (uri) {
// always return an empty stub
// but only set it as the active item for a tab type
// if it doesn't already exist
// always return an empty stub
// but only set it as the active item for a tab type
// if it doesn't already exist
case 'atom-github://dock-item/git':
item = this.createGitTabControllerStub(uri);
this.gitTabStubItem = this.gitTabStubItem || item;
Expand Down
11 changes: 10 additions & 1 deletion lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function getAtomHelperPath() {
const beta = atom.appVersion.match(/-beta/);
const appName = beta ? 'Atom Beta Helper' : 'Atom Helper';
return path.resolve(process.resourcesPath, '..', 'Frameworks',
`${appName}.app`, 'Contents', 'MacOS', appName);
`${appName}.app`, 'Contents', 'MacOS', appName);
} else {
return process.execPath;
}
Expand Down Expand Up @@ -126,6 +126,15 @@ export function firstImplementer(...targets) {
}
},

// Used by sinon
has(target, name) {
if (name === 'getImplementers') {
return true;
}

return targets.some(t => Reflect.has(t, name));
},

// Used by sinon
getOwnPropertyDescriptor(target, name) {
const firstValidTarget = targets.find(t => Reflect.getOwnPropertyDescriptor(t, name));
Expand Down
16 changes: 8 additions & 8 deletions lib/models/repository-states/present.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,21 +609,21 @@ export default class Present extends State {
if (payload.upstream) {
upstream = payload.upstream.remoteName
? Branch.createRemoteTracking(
payload.upstream.trackingRef,
payload.upstream.remoteName,
payload.upstream.remoteRef,
)
payload.upstream.trackingRef,
payload.upstream.remoteName,
payload.upstream.remoteRef,
)
: new Branch(payload.upstream.trackingRef);
}

let push = nullBranch;
if (payload.push) {
push = payload.push.remoteName
? Branch.createRemoteTracking(
payload.push.trackingRef,
payload.push.remoteName,
payload.push.remoteRef,
)
payload.push.trackingRef,
payload.push.remoteName,
payload.push.remoteRef,
)
: new Branch(payload.push.trackingRef);
}

Expand Down
7 changes: 4 additions & 3 deletions lib/views/git-tab-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ export default class GitTabView extends React.Component {
);
} else if (this.props.repository.showGitTabInit()) {
const inProgress = this.props.repository.showGitTabInitInProgress();
const message = this.props.repository.hasDirectory() ?
const message = this.props.repository.hasDirectory()
?
(
<span>Initialize <strong>{this.props.workingDirectoryPath}</strong> with a
Git repository</span>
) :
<span>Initialize a new project directory with a Git repository</span>;
)
: <span>Initialize a new project directory with a Git repository</span>;

return (
<div className="github-Panel is-empty" tabIndex="-1" ref={c => { this.refRoot = c; }}>
Expand Down
52 changes: 26 additions & 26 deletions lib/views/staging-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,19 @@ export default class StagingView extends React.Component {
{this.props.hasUndoHistory ? this.renderUndoButton() : null}
<div className="github-StagingView-list github-FilePatchListView github-StagingView-unstaged">
{
this.state.unstagedChanges.map(filePatch => (
<FilePatchListItemView
key={filePatch.filePath}
registerItemElement={this.registerItemElement}
filePatch={filePatch}
onDoubleClick={event => this.dblclickOnItem(event, filePatch)}
onContextMenu={event => this.contextMenuOnItem(event, filePatch)}
onMouseDown={event => this.mousedownOnItem(event, filePatch)}
onMouseMove={event => this.mousemoveOnItem(event, filePatch)}
selected={selectedItems.has(filePatch)}
/>
))
}
this.state.unstagedChanges.map(filePatch => (
<FilePatchListItemView
key={filePatch.filePath}
registerItemElement={this.registerItemElement}
filePatch={filePatch}
onDoubleClick={event => this.dblclickOnItem(event, filePatch)}
onContextMenu={event => this.contextMenuOnItem(event, filePatch)}
onMouseDown={event => this.mousedownOnItem(event, filePatch)}
onMouseMove={event => this.mousemoveOnItem(event, filePatch)}
selected={selectedItems.has(filePatch)}
/>
))
}
</div>
{this.renderTruncatedMessage(this.props.unstagedChanges)}
</div>
Expand All @@ -224,19 +224,19 @@ export default class StagingView extends React.Component {
</header>
<div className="github-StagingView-list github-FilePatchListView github-StagingView-staged">
{
this.state.stagedChanges.map(filePatch => (
<FilePatchListItemView
key={filePatch.filePath}
filePatch={filePatch}
registerItemElement={this.registerItemElement}
onDoubleClick={event => this.dblclickOnItem(event, filePatch)}
onContextMenu={event => this.contextMenuOnItem(event, filePatch)}
onMouseDown={event => this.mousedownOnItem(event, filePatch)}
onMouseMove={event => this.mousemoveOnItem(event, filePatch)}
selected={selectedItems.has(filePatch)}
/>
))
}
this.state.stagedChanges.map(filePatch => (
<FilePatchListItemView
key={filePatch.filePath}
filePatch={filePatch}
registerItemElement={this.registerItemElement}
onDoubleClick={event => this.dblclickOnItem(event, filePatch)}
onContextMenu={event => this.contextMenuOnItem(event, filePatch)}
onMouseDown={event => this.mousedownOnItem(event, filePatch)}
onMouseMove={event => this.mousemoveOnItem(event, filePatch)}
selected={selectedItems.has(filePatch)}
/>
))
}
</div>
{this.renderTruncatedMessage(this.props.stagedChanges)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion lib/worker-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ Sends operations to renderer processes
*/
export class RendererProcess {
constructor({loadUrl,
onDestroyed, onCrashed, onSick, onData, onCancelled, onSpawnError, onStdinError, onExecStarted}) {
onDestroyed, onCrashed, onSick, onData, onCancelled, onSpawnError, onStdinError, onExecStarted}) {
this.onDestroyed = onDestroyed;
this.onCrashed = onCrashed;
this.onSick = onSick;
Expand Down
30 changes: 15 additions & 15 deletions lib/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,22 @@ ipc.on(channelName, (event, {type, data}) => {

const spawnStart = performance.now();
GitProcess.exec(args, workingDir, options)
.then(({stdout, stderr, exitCode}) => {
const timing = {
spawnTime: spawnEnd - spawnStart,
execTime: performance.now() - spawnEnd,
};
childPidsById.delete(id);
event.sender.sendTo(managerWebContentsId, channelName, {
sourceWebContentsId,
type: 'git-data',
data: {
id,
average: averageTracker.getAverage(),
results: {stdout, stderr, exitCode, timing},
},
.then(({stdout, stderr, exitCode}) => {
const timing = {
spawnTime: spawnEnd - spawnStart,
execTime: performance.now() - spawnEnd,
};
childPidsById.delete(id);
event.sender.sendTo(managerWebContentsId, channelName, {
sourceWebContentsId,
type: 'git-data',
data: {
id,
average: averageTracker.getAverage(),
results: {stdout, stderr, exitCode, timing},
},
});
});
});
const spawnEnd = performance.now();
averageTracker.addValue(spawnEnd - spawnStart);

Expand Down
Loading