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

Description
$ git status
On branch mkt-gql-login
Your branch is up-to-date with 'origin/mkt-gql-login'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: lib/controllers/github-controller.js
modified: lib/git-shell-out-strategy.js
new file: lib/models/github-login-model.js
modified: package.json
new file: styles/github-controller.less
copied: styles/github-panel.less -> styles/github-login-view.less
modified: styles/github-panel.less
GSOS#getStatusesForChangedFiles is getting the output
M lib/controllers/github-controller.js
MM lib/git-shell-out-strategy.js
A lib/models/github-login-model.js
M package.json
A styles/github-controller.less
C styles/github-login-view.less
styles/github-panel.less
M styles/github-panel.less
The second to last line, which is the file that the file on the line before it was copied from, is causing the regex to fail. The following diff fixes:
diff --git a/lib/git-shell-out-strategy.js b/lib/git-shell-out-strategy.js
index e92a35f..d60fbb0 100644
--- a/lib/git-shell-out-strategy.js
+++ b/lib/git-shell-out-strategy.js
@@ -164,6 +164,7 @@ export default class GitShellOutStrategy {
const statusMap = {
'A': 'added',
+ 'C': 'added', // technically copied, but we'll treat as added
'M': 'modified',
'D': 'deleted',
'U': 'modified',
@@ -205,6 +206,10 @@ export default class GitShellOutStrategy {
if (x !== ' ' && x !== '?') {
stagedFiles[filePath] = statusMap[x];
}
+ if (x === 'C') {
+ // skip the next line, which is the copied file
+ i++
+ }
}
}