1
1
mirror of https://github.com/go-gitea/gitea synced 2025-09-15 21:28:15 +00:00

Fix different behavior in status check pattern matching with double stars (#35474)

Drop the minimatch dependency, use our own glob compiler.

Fix #35473
This commit is contained in:
wxiaoguang
2025-09-13 11:53:27 +08:00
committed by GitHub
parent 866c636f52
commit 325e059a50
6 changed files with 325 additions and 6 deletions

View File

@@ -1,9 +1,9 @@
import {minimatch} from 'minimatch';
import {createMonaco} from './codeeditor.ts';
import {onInputDebounce, queryElems, toggleElem} from '../utils/dom.ts';
import {POST} from '../modules/fetch.ts';
import {initRepoSettingsBranchesDrag} from './repo-settings-branches.ts';
import {fomanticQuery} from '../modules/fomantic/base.ts';
import {globMatch} from '../utils/glob.ts';
const {appSubUrl, csrfToken} = window.config;
@@ -108,7 +108,7 @@ function initRepoSettingsBranches() {
let matched = false;
const statusCheck = el.getAttribute('data-status-check');
for (const pattern of validPatterns) {
if (minimatch(statusCheck, pattern, {noext: true})) { // https://github.com/go-gitea/gitea/issues/33121 disable extended glob syntax
if (globMatch(statusCheck, pattern, '/')) {
matched = true;
break;
}