From 75607faed3dd1cc13c1fc145382bbf5e2c9181f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=BD=E6=9C=88?= Date: Wed, 16 Oct 2019 19:00:32 +0800 Subject: [PATCH 1/2] Update git-add.js tested this way is the simplest to resolve #2151 #1075 #2267 #2141 #2113 #1096 #216 etc.... ------- > -u, --update > Update the index just where it already has an entry matching . This removes as well as modifies index entries to match the working tree, but adds no new files. > > If no is given when -u option is used, all tracked files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories). It has a flaw in that it cannot track the newly created files, but no new files are created in our scenario, so it is suitable for us. --- commands/version/lib/git-add.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/version/lib/git-add.js b/commands/version/lib/git-add.js index 1180890cbc..043f0422b2 100644 --- a/commands/version/lib/git-add.js +++ b/commands/version/lib/git-add.js @@ -12,5 +12,5 @@ function gitAdd(files, opts) { const filePaths = files.map(file => slash(path.relative(opts.cwd, path.resolve(opts.cwd, file)))); - return childProcess.exec("git", ["add", "--", ...filePaths], opts); + return childProcess.exec("git", ["add", "-u","--", ...filePaths], opts); } From d2586c4919366d32f36fe3649e8724ea2751911a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=BD=E6=9C=88?= Date: Wed, 16 Oct 2019 19:03:54 +0800 Subject: [PATCH 2/2] tslint --- commands/version/lib/git-add.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/version/lib/git-add.js b/commands/version/lib/git-add.js index 043f0422b2..f125b1765a 100644 --- a/commands/version/lib/git-add.js +++ b/commands/version/lib/git-add.js @@ -12,5 +12,5 @@ function gitAdd(files, opts) { const filePaths = files.map(file => slash(path.relative(opts.cwd, path.resolve(opts.cwd, file)))); - return childProcess.exec("git", ["add", "-u","--", ...filePaths], opts); + return childProcess.exec("git", ["add", "-u", "--", ...filePaths], opts); }