mirror of
https://github.com/cmderdev/cmder.git
synced 2025-06-13 13:17:55 +08:00
Add simple branch name gen for sh and ps1
This commit is contained in:
8
vendor/psmodules/Cmder.ps1
vendored
8
vendor/psmodules/Cmder.ps1
vendored
@ -36,6 +36,14 @@ function checkGit($Path) {
|
||||
|
||||
if (getGitStatusSetting -eq $true) {
|
||||
Write-VcsStatus
|
||||
} else {
|
||||
$headContent = Get-Content (Join-Path $Path '.git/HEAD')
|
||||
if ($headContent -like "ref: refs/heads/*") {
|
||||
$branchName = $headContent.Substring(16)
|
||||
} else {
|
||||
$branchName = "HEAD detached at $($headContent.Substring(0, 7))"
|
||||
}
|
||||
Write-Host " [$branchName]" -NoNewline -ForegroundColor DarkGray
|
||||
}
|
||||
|
||||
return
|
||||
|
Reference in New Issue
Block a user