Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/prepare_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,16 @@ export default class ReleasePreparation extends Session {
runSync('git', ['fetch', this.upstream, 'tag', '-n', tagName]);
this.cli.stopSpinner(`Tag fetched: ${tagName}`);
}
try {
if (runSync('git', ['describe', '--abbrev=0', '--tags']).trim() !== tagName) {
this.cli.warn(`${tagName} is not the closest tag`);
}
} catch {
this.cli.startSpinner(`${tagName} is unreachable from the current HEAD`);
runSync('git', ['fetch', '--shallow-exclude', tagName, this.upstream, this.branch]);
runSync('git', ['fetch', '--deepen=1', this.upstream, this.branch]);
this.cli.stopSpinner('Local clone unshallowed');
}
return tagName;
}

Expand Down
Loading