mirror of
https://github.com/VirtualHotBar/NetMount.git
synced 2026-05-07 21:57:09 +08:00
fix: 修复获取上一个标签的逻辑以确保正确处理当前标签
This commit is contained in:
@@ -57,7 +57,10 @@ try {
|
||||
console.warn(`Tag ${currentTag} not found locally. Using HEAD as end of range.`);
|
||||
}
|
||||
|
||||
const prevTag = tags.find((t) => t !== currentTag) || '';
|
||||
const currentTagIndex = tags.indexOf(currentTag);
|
||||
const prevTag = tagExists
|
||||
? (currentTagIndex >= 0 ? tags[currentTagIndex + 1] || '' : '')
|
||||
: tags[0] || '';
|
||||
const endRef = tagExists ? currentTag : 'HEAD';
|
||||
const range = prevTag ? `${prevTag}..${endRef}` : endRef;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user