shumadrid_obsidian-git-chan.../src/core/gitOperations/runHashObjectEmptyTree.ts
2025-04-08 03:39:44 +02:00

17 lines
308 B
TypeScript

import type { SimpleGit } from 'simple-git';
export async function runHashObjectEmptyTree({
git
}: {
git: SimpleGit;
}): Promise<string> {
const emptyTreeHash = await git.raw([
'hash-object',
'-t',
'tree',
'/dev/null'
]);
// Trimming is required.
return emptyTreeHash.trim();
}