1
0
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:
s2
2019-06-07 12:37:30 +02:00
parent 029712a32b
commit 9b0377efc9

View File

@@ -12,7 +12,7 @@ const args = require('minimist')(process.defaultApp ? process.argv.slice(3) : pr
const repoDir = path.resolve(path.normalize(args._.join(' ')));
function getLfsFileList(dir, cb) {
exec('git lfs ls-files', {
exec('git ls-files | git check-attr --stdin lockable', {
maxBuffer: 1024 * 1024,
cwd: dir
},
@@ -26,10 +26,11 @@ function getLfsFileList(dir, cb) {
if (stdout) {
let files = stdout.split('\n');
files.forEach((file) => {
let pos = file.search(/ \* | \- /);
if (pos) {
file = file.substring(pos + 3);
if (file) {
let pos = file.split(': lockable: ');
if (pos && pos.length === 2) {
file = pos[0];
status = pos[1];
if (file && status === 'set') {
parsedFiles.push(file.trim());
}
}