Skip to content

Commit

Permalink
issue #436 - specify a file which stage status is being checked (perf…
Browse files Browse the repository at this point in the history
…ormance fix)
  • Loading branch information
zaggino committed Apr 22, 2014
1 parent a529656 commit f5108aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/git/GitCli.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ define(function (require, exports) {
function stage(file, updateIndex) {
var args = ["add"];
if (updateIndex) { args.push("-u"); }
args.push(file);
args.push("--", file);
return git(args);
}

Expand Down Expand Up @@ -629,7 +629,7 @@ define(function (require, exports) {
}

function _isFileStaged(file) {
return git(["status", "-u", "--porcelain"]).then(function (stdout) {
return git(["status", "-u", "--porcelain", "--", file]).then(function (stdout) {
if (!stdout) { return false; }
return _.any(stdout.split("\n"), function (line) {
return line.match("^(\\S)(.)\\s+(" + file + ")$") !== null;
Expand Down

0 comments on commit f5108aa

Please sign in to comment.