mirror of
https://github.com/S2-/gitlit
synced 2025-08-03 04:40:05 +02:00
show all lockable files
This commit is contained in:
11
app/main.js
11
app/main.js
@@ -12,7 +12,7 @@ const args = require('minimist')(process.defaultApp ? process.argv.slice(3) : pr
|
|||||||
const repoDir = path.resolve(path.normalize(args._.join(' ')));
|
const repoDir = path.resolve(path.normalize(args._.join(' ')));
|
||||||
|
|
||||||
function getLfsFileList(dir, cb) {
|
function getLfsFileList(dir, cb) {
|
||||||
exec('git lfs ls-files', {
|
exec('git ls-files | git check-attr --stdin lockable', {
|
||||||
maxBuffer: 1024 * 1024,
|
maxBuffer: 1024 * 1024,
|
||||||
cwd: dir
|
cwd: dir
|
||||||
},
|
},
|
||||||
@@ -26,10 +26,11 @@ function getLfsFileList(dir, cb) {
|
|||||||
if (stdout) {
|
if (stdout) {
|
||||||
let files = stdout.split('\n');
|
let files = stdout.split('\n');
|
||||||
files.forEach((file) => {
|
files.forEach((file) => {
|
||||||
let pos = file.search(/ \* | \- /);
|
let pos = file.split(': lockable: ');
|
||||||
if (pos) {
|
if (pos && pos.length === 2) {
|
||||||
file = file.substring(pos + 3);
|
file = pos[0];
|
||||||
if (file) {
|
status = pos[1];
|
||||||
|
if (file && status === 'set') {
|
||||||
parsedFiles.push(file.trim());
|
parsedFiles.push(file.trim());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user