From 97cba5e920f240cc9565a4ba32431dcaeb6bf198 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Mon, 13 Sep 2021 15:10:21 -0700 Subject: [PATCH] build: use `--deepen` in place of `--depth` during fetches in rebasing 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. --- tools/local-actions/changelog/lib/main.ts | 2 +- tools/local-actions/changelog/main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/local-actions/changelog/lib/main.ts b/tools/local-actions/changelog/lib/main.ts index 4e42588c5..3ca4eda98 100644 --- a/tools/local-actions/changelog/lib/main.ts +++ b/tools/local-actions/changelog/lib/main.ts @@ -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`); diff --git a/tools/local-actions/changelog/main.js b/tools/local-actions/changelog/main.js index d5567471c..58f27e756 100644 --- a/tools/local-actions/changelog/main.js +++ b/tools/local-actions/changelog/main.js @@ -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`);