Skip to content

Commit

Permalink
fix(git): use branch --show-current to get current branch (CodeEdit…
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanBorai authored and FastestMolasses committed Apr 11, 2024
1 parent a52ff01 commit d79984b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CodeEdit/Features/Git/Client/GitClient+Branches.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extension GitClient {

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

0 comments on commit d79984b

Please sign in to comment.