Skip to content

Commit

Permalink
build: use --deepen in place of --depth during fetches in rebasing
Browse files Browse the repository at this point in the history
Previously we used `--depth` to ensure that enough commits were included in the repository to effectively
perform create changlogs.  However, using `--depth` sets the depth of the repository, and if the repository
previously was unshallow, it because a shallow repository.  Instead by using deepen, the depth will be
increased by the provided value. This will ensure that the enough commits are included and will be a noop
if an unshallow repo is deepened further.
  • Loading branch information
josephperrott authored and devversion committed Sep 14, 2021
1 parent 9416a56 commit 97cba5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/local-actions/changelog/lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function writeAndAddToGit(filePath: string, contents: string) {
function getLatestRefFromUpstream(branchOrTag: string) {
try {
const git = AuthenticatedGitClient.get();
git.runGraceful(['fetch', git.getRepoGitUrl(), branchOrTag, '--depth=250']);
git.runGraceful(['fetch', git.getRepoGitUrl(), branchOrTag, '--deepen=250']);
return git.runGraceful(['rev-parse', 'FETCH_HEAD']).stdout.trim();
} catch {
core.error(`Unable to retrieve '${branchOrTag}' from upstream`);
Expand Down
2 changes: 1 addition & 1 deletion tools/local-actions/changelog/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54772,7 +54772,7 @@ function writeAndAddToGit(filePath, contents) {
function getLatestRefFromUpstream(branchOrTag) {
try {
const git = authenticated_git_client_1.AuthenticatedGitClient.get();
git.runGraceful(["fetch", git.getRepoGitUrl(), branchOrTag, "--depth=250"]);
git.runGraceful(["fetch", git.getRepoGitUrl(), branchOrTag, "--deepen=250"]);
return git.runGraceful(["rev-parse", "FETCH_HEAD"]).stdout.trim();
} catch {
core.error(`Unable to retrieve '${branchOrTag}' from upstream`);
Expand Down

0 comments on commit 97cba5e

Please sign in to comment.