Function
defaultIsAncestor
(projectRoot, ancestor, descendant)
Source from the content-addressed store, hash-verified
| 107 | } |
| 108 | |
| 109 | function defaultIsAncestor(projectRoot, ancestor, descendant) { |
| 110 | if (!ancestor || !descendant || ancestor === descendant) return false; |
| 111 | try { |
| 112 | childProcess.execFileSync('git', ['merge-base', '--is-ancestor', ancestor, descendant], { |
| 113 | cwd: projectRoot, |
| 114 | stdio: 'ignore', |
| 115 | }); |
| 116 | return true; |
| 117 | } catch { |
| 118 | return false; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | function resolveGitRef(projectRoot, ref) { |
| 123 | if (!ref) return null; |
Tested by
no test coverage detected