Skip to content

Commit 7c36e56

Browse files
authored
fix(git): use branch --show-current to get current branch (#1597)
1 parent 679ead2 commit 7c36e56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CodeEdit/Features/Git/Client/GitClient+Branches.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extension GitClient {
3131

3232
/// Get current branch
3333
func getCurrentBranch() async throws -> GitBranch? {
34-
let branchName = try await run("rev-parse --abbrev-ref HEAD").trimmingCharacters(in: .whitespacesAndNewlines)
34+
let branchName = try await run("branch --show-current").trimmingCharacters(in: .whitespacesAndNewlines)
3535
let components = try await run(
3636
"for-each-ref --format=\"%(refname)|%(upstream:short)\" refs/heads/\(branchName)"
3737
)

0 commit comments

Comments
 (0)