feat(GitRepo): Add glob-pattern exclusions for getUncommittedDiff and add minimatch; bump dependencies
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartgit',
|
||||
version: '3.1.1',
|
||||
version: '3.3.0',
|
||||
description: 'A smart wrapper for nodegit that simplifies Git operations in Node.js.'
|
||||
}
|
||||
|
||||
@@ -122,8 +122,8 @@ export class GitRepo {
|
||||
const diffs: string[] = [];
|
||||
for (const row of statusMatrix) {
|
||||
const [filepath, head, workdir] = row;
|
||||
if (excludeFiles.includes(filepath)) {
|
||||
continue; // Skip excluded files
|
||||
if (excludeFiles.some(pattern => filepath === pattern || plugins.minimatch(filepath, pattern))) {
|
||||
continue; // Skip excluded files (supports exact matches and glob patterns)
|
||||
}
|
||||
|
||||
let headContent = '';
|
||||
|
||||
@@ -15,5 +15,6 @@ export { smartenv, smartfile, smartpath, smartpromise, smartstring, smarttime };
|
||||
// third party
|
||||
import * as diff from 'diff';
|
||||
import isomorphicGit from 'isomorphic-git';
|
||||
import { minimatch } from 'minimatch';
|
||||
|
||||
export { diff, isomorphicGit };
|
||||
export { diff, isomorphicGit, minimatch };
|
||||
|
||||
Reference in New Issue
Block a user