Skip to content

Commit

Permalink
change all status messages to arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
sentientwaffle committed Mar 24, 2012
1 parent a92e358 commit 133f556
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/status.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ module.exports = S = (repo, callback) ->
return callback err, status


BEGIN_STAGED = "# Changes to be committed:"
BEGIN_STAGED = [
"# Changes to be committed:"
]
BEGIN_UNSTAGED = [
"# Changed but not updated:"
"# Changes not staged for commit:"
]
BEGIN_UNTRACKED = "# Untracked files:"
BEGIN_UNTRACKED = [
"# Untracked files:"
]
FILE = /^#\s+([^\s]+)[:]\s+(.+)$/
TYPES =
added: "A"
Expand All @@ -31,13 +35,13 @@ S.Status = class Status
@clean = true
state = null
for line in text.split("\n")
if line == BEGIN_STAGED
if ~BEGIN_STAGED.indexOf(line)
state = "staged"
@clean = false
else if ~BEGIN_UNSTAGED.indexOf(line)
state = "unstaged"
@clean = false
else if line == BEGIN_UNTRACKED
else if ~BEGIN_UNTRACKED.indexOf(line)
state = "untracked"
@clean = false
else if state && match = FILE.exec(line)
Expand Down

0 comments on commit 133f556

Please sign in to comment.