Skip to content

Commit

Permalink
Fix branch display on repo's without commits. (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xWDG authored Mar 4, 2024
1 parent f8386dc commit 4660122
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Version-Control/Base/Commands/Branch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public struct Branch { // swiftlint:disable:this type_body_length
/// - Throws: An error if the shell command fails.
public func getCurrentBranch(directoryURL: URL) throws -> String {
return try ShellClient.live().run(
"cd \(directoryURL.relativePath.escapedWhiteSpaces());git rev-parse --abbrev-ref HEAD"
"cd \(directoryURL.relativePath.escapedWhiteSpaces());git branch --show-current"
).removingNewLines()
}

Expand Down

0 comments on commit 4660122

Please sign in to comment.