Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Move #2445 behind
--no-granular-pathspec
option
Fixes #2598
- Loading branch information
Showing
13 changed files
with
189 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.log | ||
# simulate a "dynamic", intentionally unversioned package by gitignoring it | ||
packages/dynamic-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
"use strict"; | ||
|
||
const log = require("npmlog"); | ||
const path = require("path"); | ||
const slash = require("slash"); | ||
const childProcess = require("@lerna/child-process"); | ||
|
||
module.exports = gitAdd; | ||
|
||
function gitAdd(files, opts) { | ||
function gitAdd(changedFiles, gitOpts, execOpts) { | ||
// granular pathspecs should be relative to the git root, but that isn't necessarily where lerna lives | ||
const files = gitOpts.granularPathspec | ||
? changedFiles.map(file => slash(path.relative(execOpts.cwd, path.resolve(execOpts.cwd, file)))) | ||
: "."; | ||
|
||
log.silly("gitAdd", files); | ||
|
||
return childProcess.exec("git", ["add", "--", "."], opts); | ||
return childProcess.exec("git", ["add", "--", ...files], execOpts); | ||
} |