(filePath)
| 103 | |
| 104 | // Utility: Get local file hash (Git blob format) |
| 105 | const getLocalHash = (filePath) => { |
| 106 | const stats = fsSync.statSync(filePath); |
| 107 | const buffer = fsSync.readFileSync(filePath); |
| 108 | const bufferWithHeader = Buffer.concat([ |
| 109 | Buffer.from('blob '), |
| 110 | Buffer.from(`${stats.size}`), |
| 111 | Buffer.from('\0'), |
| 112 | buffer |
| 113 | ]); |
| 114 | const hash = crypto.createHash('sha1').update(bufferWithHeader).digest('hex'); |
| 115 | |
| 116 | if (config.verbose) { |
| 117 | console.log(`${LOG_TAG} \t\tgetLocalHash ${filePath} ${hash}`); |
| 118 | } |
| 119 | |
| 120 | return hash; |
| 121 | }; |
| 122 | |
| 123 | // Utility: Create GitHub API options |
| 124 | const createGitHubOptions = (repoPath) => { |
no test coverage detected