Skip to content

Commit 73d0f5a

Browse files
AtkinsSJKernelDeimos
authored andcommitted
fix(git): Make git commit display detached HEAD correctly
1 parent dd10a37 commit 73d0f5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/git/src/subcommands/commit.js

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

0 commit comments

Comments
 (0)