mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-07-03 05:31:17 +02:00
refactor(git): rename helper to gcbn and optimize code based on review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
726cedd375
commit
0002238f40
1 changed files with 7 additions and 4 deletions
|
|
@ -68,12 +68,15 @@ function grename() {
|
|||
# (sorted alphabetically by function name)
|
||||
# (order should follow README)
|
||||
#
|
||||
function gcb() {
|
||||
# Controlla se siamo in un repository Git
|
||||
function gcbn() {
|
||||
# Check if we are in a Git repository
|
||||
command git rev-parse --is-inside-work-tree &>/dev/null || return
|
||||
|
||||
# Prende il branch corrente, rimuove il newline e lo copia negli appunti
|
||||
command git branch --show-current | tr -d '\n' | clipcopy
|
||||
local branch
|
||||
branch="$(git_current_branch)" || return
|
||||
[[ -n "$branch" ]] || return 1
|
||||
|
||||
print -rn -- "$branch" | clipcopy
|
||||
}
|
||||
|
||||
# Similar to `gunwip` but recursive "Unwips" all recent `--wip--` commits not just the last one
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue