MCPcopy Create free account
hub / github.com/Silentely/eSIM-Tools / getDiffRange

Function getDiffRange

scripts/pre-push-check.js:32–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30}
31
32function getDiffRange() {
33 try {
34 const upstream = runGit([
35 'rev-parse',
36 '--abbrev-ref',
37 '--symbolic-full-name',
38 '@{upstream}'
39 ]).trim();
40 if (upstream) {
41 return `${upstream}...HEAD`;
42 }
43 } catch (_) {
44 // ignore and fallback
45 }
46
47 try {
48 runGit(['rev-parse', '--verify', 'HEAD~1']);
49 return 'HEAD~1..HEAD';
50 } catch (_) {
51 return null;
52 }
53}
54
55function getRelatedFiles() {
56 const range = getDiffRange();

Callers 2

getRelatedFilesFunction · 0.85
getTouchedProtectedFilesFunction · 0.85

Calls 1

runGitFunction · 0.85

Tested by

no test coverage detected