fix(git): Make git commit display detached HEAD correctly

This commit is contained in:
Sam Atkins 2024-06-26 15:47:35 +01:00 committed by Eric Dubé
parent dd10a37749
commit 73d0f5a90c

View File

@ -99,7 +99,7 @@ export default {
}); });
const commit_title = options.message.split('\n')[0]; const commit_title = options.message.split('\n')[0];
const short_hash = await shorten_hash({ fs, dir, gitdir, cache }, commit_hash); const short_hash = await shorten_hash({ fs, dir, gitdir, cache }, commit_hash);
let output = `[${branch} ${short_hash}] ${commit_title}\n`; let output = `[${branch ?? 'detached HEAD'} ${short_hash}] ${commit_title}\n`;
// TODO: --amend prints out the date of the original commit here, as: // TODO: --amend prints out the date of the original commit here, as:
// ` Date: Fri May 17 15:45:47 2024 +0100` // ` Date: Fri May 17 15:45:47 2024 +0100`
// TODO: Print out file change count, insertion count, and deletion count // TODO: Print out file change count, insertion count, and deletion count