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

Commit a8b805d

Browse files
committed
Extract ATOM_COMMIT_EDITMSG_PATH constant
1 parent adef1e7 commit a8b805d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/controllers/commit-view-controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import ModelStateRegistry from '../models/model-state-registry';
1111
import {readFile} from '../helpers';
1212

1313
const COMMIT_GRAMMAR_SCOPE = 'text.git-commit';
14+
const ATOM_COMMIT_EDITMSG_PATH = path.join(this.props.repository.getGitDirectoryPath(), 'ATOM_COMMIT_EDITMSG');
1415

1516
export default class CommitViewController {
1617
static focus = {
@@ -115,8 +116,7 @@ export default class CommitViewController {
115116

116117
@autobind
117118
async openCommitEditor(messageFromBox) {
118-
const atomCommitMessagePath = path.join(this.props.repository.getGitDirectoryPath(), 'ATOM_COMMIT_EDITMSG');
119-
const editor = await this.props.workspace.open(atomCommitMessagePath);
119+
const editor = await this.props.workspace.open(ATOM_COMMIT_EDITMSG_PATH);
120120
editor.setText(messageFromBox);
121121
this.deactivateCommitBox = true;
122122

@@ -130,7 +130,7 @@ export default class CommitViewController {
130130
etch.update(this);
131131

132132
this.editorSubscription = editor.onDidDestroy(async () => {
133-
const contents = await readFile(atomCommitMessagePath);
133+
const contents = await readFile(ATOM_COMMIT_EDITMSG_PATH);
134134
this.regularCommitMessage = contents;
135135
this.deactivateCommitBox = false;
136136
this.editorSubscription.dispose();

0 commit comments

Comments
 (0)