Skip to content

Commit e90461a

Browse files
authored
perf(tools): avoid initialization interruption in single branch forks (cotes2020#992)
1 parent 6f6e309 commit e90461a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/init

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ check_env() {
7777
_check_init
7878
}
7979

80-
checkout_latest_tag() {
81-
tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
82-
git reset --hard "$tag"
80+
checkout_latest_release() {
81+
hash=$(git log --grep="chore(release):" -1 --pretty="%H")
82+
git reset --hard "$hash"
8383
}
8484

8585
init_files() {
@@ -114,7 +114,7 @@ commit() {
114114

115115
main() {
116116
check_env
117-
checkout_latest_tag
117+
checkout_latest_release
118118
init_files
119119
commit
120120
}

0 commit comments

Comments
 (0)