mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-12-04 14:19:04 +01:00
fix(changelog): hide reverted commits again after the switch to 12-char hashes (#14262)
* fix(changelog): hide reverted commits again after the switch to 12-char hashes Since #12096 the commit list is read with `--abbrev=12`, so the `types` array is keyed by 12-character hashes, but `commit:is-revert` still returned the first 7 characters of the reverted hash. The lookup in `display-release` never matched, and both a reverted commit and its `Revert "..."` commit were listed in the changelog. * test(changelog): cover hiding reverted commits
This commit is contained in:
1 parent
ca0a63f0ee
commit
87aa1a9b89
2 files changed
+60
-1
No files matched your search
+2
-1
@@ -119,12 +119,13 @@ function parse-commit {
|
||||
}
|
||||
|
||||
# Return truncated hash of the reverted commit
|
||||
# (12 characters, to match the commit hashes from `git log --abbrev=12`)
|
||||
function commit:is-revert {
|
||||
local subject="$1" body="$2"
|
||||
|
||||
if [[ "$subject" = Revert* && \
|
||||
"$body" =~ "This reverts commit ([^.]+)\." ]]; then
|
||||
echo "${match[1]:0:7}"
|
||||
echo "${match[1]:0:12}"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user