Skip to content

Commit

Permalink
fix: include lightweight tags in check
Browse files Browse the repository at this point in the history
Many repositories use lightweight (non-annotated) tags. This patch
eliminates the scary warning that no tags were found, even if there were
tags available.

This makes the script match the behavior of `cog` itself (i.e., git
describe --tags --abbrev=0) [[1]].

[1]: https://github.com/cocogitto/cocogitto/blob/main/src/git/revspec.rs#L347-L357

Closes: #11
Signed-off-by: Luke Hsiao <luke.hsiao@numbersstation.ai>
  • Loading branch information
lukehsiao authored and oknozor committed Aug 17, 2023
1 parent ac62601 commit ee06dcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ git config --global user.email "$GIT_USER_EMAIL"

if [ "$CHECK" = "true" ]; then
if [ "$LATEST_TAG_ONLY" = "true" ]; then
if [ "$(git describe --abbrev=0)" ]; then
message="Checking commits from $(git describe --abbrev=0)"
if [ "$(git describe --tags --abbrev=0)" ]; then
message="Checking commits from $(git describe --tags --abbrev=0)"
else
message="No tag found checking history from first commit"
fi
Expand Down

0 comments on commit ee06dcd

Please sign in to comment.