Download tasks/codeql_javascript_benchmark_top30_v1/morefixes-99aea6539029d3ab985e/patch.diff from Benchanything/checkerbench: direct link, hf CLI and curl.
- Browser
- Download file 3.67 kB
-
https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_javascript_benchmark_top30_v1/morefixes-99aea6539029d3ab985e/patch.diff
- Command line
-
hf download hf://datasets/Benchanything/checkerbench/tasks/codeql_javascript_benchmark_top30_v1/morefixes-99aea6539029d3ab985e/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_javascript_benchmark_top30_v1/morefixes-99aea6539029d3ab985e/patch.diff
3.67 kB
| diff --git a/locale/scripts/locale-branch-manager.js b/locale/scripts/locale-branch-manager.js | |
| index 5b06e4f9b..949364209 100644 | |
| --- a/locale/scripts/locale-branch-manager.js | |
| +++ b/locale/scripts/locale-branch-manager.js | |
| * node locale/scripts/locale-branch-manager.js --get-version | |
| */ | |
| -const { execSync } = require('child_process'); | |
| +const { execFileSync } = require('child_process'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| // Helpers | |
| -function run(cmd, options = {}) { | |
| +function run(program, args = [], options = {}) { | |
| try { | |
| - const out = execSync(cmd, { encoding: 'utf8', ...options }); | |
| + const out = execFileSync(program, args, { encoding: 'utf8', ...options }); | |
| return out.trim(); | |
| } catch (err) { | |
| if (options.allowFail) return null; | |
| function getAutoVersion() { | |
| // Try git describe (if in a tag) | |
| try { | |
| - const tag = run('git describe --tags --abbrev=0', { allowFail: true }); | |
| + const tag = run('git', ['describe', '--tags', '--abbrev=0'], { allowFail: true }); | |
| if (tag && /^\d+\.\d+\.\d+/.test(tag)) { | |
| return tag.replace(/^v/, '').split('-')[0]; // strip 'v' prefix and '-*' suffixes | |
| } | |
| function extractVersionFromBranch(branchName) { | |
| * Get current branch name | |
| */ | |
| function getCurrentBranch() { | |
| - return run('git rev-parse --abbrev-ref HEAD', { allowFail: true }) || 'master'; | |
| + return run('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { allowFail: true }) || 'master'; | |
| } | |
| /** | |
| function initBranch(version) { | |
| const branchName = buildBranchName(version); | |
| // Branch already exists on remote? | |
| - const existsRemote = run(`git ls-remote --heads origin ${branchName}`, { allowFail: true }); | |
| + const existsRemote = run('git', ['ls-remote', '--heads', 'origin', branchName], { allowFail: true }); | |
| if (existsRemote) { | |
| console.log(`✅ Checking out existing branch: ${branchName}`); | |
| - run(`git fetch origin ${branchName}`); | |
| - run(`git checkout -b ${branchName} origin/${branchName}`, { allowFail: true }); | |
| + run('git', ['fetch', 'origin', branchName]); | |
| + run('git', ['checkout', '-b', branchName, `origin/${branchName}`], { allowFail: true }); | |
| return branchName; | |
| } | |
| // Create new branch | |
| console.log(`🌿 Creating new locale branch: ${branchName}`); | |
| - run(`git checkout -b ${branchName}`); | |
| - run(`git push -u origin ${branchName}`); | |
| + run('git', ['checkout', '-b', branchName]); | |
| + run('git', ['push', '-u', 'origin', branchName]); | |
| return branchName; | |
| } | |
| function commitAndPush(localeCode, languageName, termCount) { | |
| const message = `locale: translate ${localeCode} (${languageName}, ${termCount} terms)`; | |
| console.log(`\n 📝 Committing to ${branch}...`); | |
| - run(`git add locale/terms/missing/${localeCode}/`); | |
| - run(`git commit -m "${message}"`); | |
| + run('git', ['add', `locale/terms/missing/${localeCode}/`]); | |
| + run('git', ['commit', '-m', message]); | |
| console.log(` ⬆️ Pushing to origin/${branch}...`); | |
| - run(`git push origin ${branch}`); | |
| + run('git', ['push', 'origin', branch]); | |
| console.log(` ✅ Committed and pushed\n`); | |
| } | |
| function getTranslatedLocales() { | |
| // Get commits unique to this branch vs master | |
| const commits = run( | |
| - `git log origin/master..origin/${branch} --pretty=format:%B`, | |
| + 'git', ['log', `origin/master..origin/${branch}`, '--pretty=format:%B'], | |
| { allowFail: true } | |
| ); | |
| if (!commits) return []; | |