mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-11-29 11:53:03 +01:00
Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe140cbbf4 | ||
|
|
e1142d77ee | ||
|
|
a77431ce82 | ||
|
|
657ef5744d | ||
|
|
9f9b28a13d | ||
|
|
361fb5c1ac | ||
|
|
3d9b557be3 | ||
|
|
60c9a7a839 | ||
|
|
d745fbf3bd | ||
|
|
277993de0a | ||
|
|
4d4cfc287e | ||
|
|
92bf53f1ae | ||
|
|
5c4bb4aec5 | ||
|
|
868da9cfd5 |
No files matched your search
@@ -46,7 +46,7 @@ dependencies:
|
||||
plugins/z:
|
||||
branch: master
|
||||
repo: agkozak/zsh-z
|
||||
version: 102fb78036ed76feedf623907483691777a1d510
|
||||
version: 7f8ff4df11b50a14e3666c7cd212baa399c9b92a
|
||||
precopy: |
|
||||
set -e
|
||||
rm -r tests
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
certifi==2026.7.22
|
||||
charset-normalizer==3.5.1
|
||||
charset-normalizer==3.5.2
|
||||
idna==3.20
|
||||
PyYAML==6.0.3
|
||||
requests==2.34.2
|
||||
|
||||
@@ -25,10 +25,10 @@ if [[ "$OSTYPE" = darwin* ]]; then
|
||||
echo "$(ioreg -rc AppleSmartBattery | grep -o '"Watts"=[0-9]\+' | head -1 | grep -o '[0-9]\+')W "
|
||||
}
|
||||
function battery_is_charging() {
|
||||
ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ Yes'
|
||||
ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected" = Yes'
|
||||
}
|
||||
function battery_pct() {
|
||||
pmset -g batt | grep -Eo "\d+%" | cut -d% -f1
|
||||
pmset -g batt | grep -Eo "[0-9]+%" | cut -d% -f1
|
||||
}
|
||||
function battery_pct_remaining() {
|
||||
if battery_is_charging; then
|
||||
@@ -39,8 +39,8 @@ if [[ "$OSTYPE" = darwin* ]]; then
|
||||
}
|
||||
function battery_time_remaining() {
|
||||
local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
|
||||
if [[ $(echo $smart_battery_status | command grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]]; then
|
||||
timeremaining=$(echo $smart_battery_status | command grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
|
||||
if [[ $(echo $smart_battery_status | command grep -c '^.*"ExternalConnected" = No') -eq 1 ]]; then
|
||||
timeremaining=$(echo $smart_battery_status | command grep '^.*"AvgTimeToEmpty" = ' | sed -e 's/^.*"AvgTimeToEmpty" = //')
|
||||
if [ $timeremaining -gt 720 ]; then
|
||||
echo "::"
|
||||
else
|
||||
@@ -52,7 +52,7 @@ if [[ "$OSTYPE" = darwin* ]]; then
|
||||
}
|
||||
function battery_pct_prompt () {
|
||||
local battery_pct color
|
||||
if ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ No'; then
|
||||
if ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected" = No'; then
|
||||
battery_pct=$(battery_pct_remaining)
|
||||
if [[ $battery_pct -gt 50 ]]; then
|
||||
color='green'
|
||||
|
||||
@@ -35,7 +35,9 @@ alias eeval="$EMACS_PLUGIN_LAUNCHER --eval"
|
||||
alias eframe='emacsclient --alternate-editor="" --create-frame'
|
||||
|
||||
# Emacs ANSI Term tracking
|
||||
if [[ -n "$INSIDE_EMACS" ]] && [[ "$INSIDE_EMACS" != "vterm" ]]; then
|
||||
local excluded_terms=(vterm ghostel)
|
||||
local current_term="${INSIDE_EMACS%%,*}"
|
||||
if [[ -n "$INSIDE_EMACS" ]] && (( ! ${excluded_terms[(Ie)$current_term]} )); then
|
||||
chpwd_emacs() { print -P "\033AnSiTc %d"; }
|
||||
print -P "\033AnSiTc %d" # Track current working directory
|
||||
print -P "\033AnSiTu %n" # Track username
|
||||
|
||||
@@ -119,7 +119,17 @@ EOF
|
||||
fi ;;
|
||||
(*.rpm)
|
||||
rpm2cpio "$full_path" | cpio --quiet -id ;;
|
||||
(*.7z | *.7z.[0-9]* | *.pk7) 7za x "$full_path" ;;
|
||||
(*.7z | *.7z.[0-9]* | *.pk7)
|
||||
if (( $+commands[7zz] )); then
|
||||
7zz x "$full_path"
|
||||
elif (( $+commands[7z] )); then
|
||||
7z x "$full_path"
|
||||
elif (( $+commands[7za] )); then
|
||||
7za x "$full_path"
|
||||
else
|
||||
echo "extract: cannot extract 7z files: install 7zz, 7z or 7za" >&2
|
||||
success=1
|
||||
fi ;;
|
||||
(*.deb)
|
||||
command mkdir -p "control" "data"
|
||||
ar vx "$full_path" > /dev/null
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# logcli plugin
|
||||
|
||||
This plugin adds completion for [Grafana Loki's logcli](https://grafana.com/docs/loki/latest/query/logcli/).
|
||||
|
||||
To use it, add `logcli` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... logcli)
|
||||
```
|
||||
|
||||
This plugin does not add any aliases.
|
||||
|
||||
## Cache
|
||||
|
||||
This plugin caches the completion script and automatically updates it when the
|
||||
plugin is loaded, which is usually when you start a new terminal emulator.
|
||||
|
||||
The cache is stored at `$ZSH_CACHE_DIR/completions/_logcli`.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Autocompletion for Grafana Loki's CLI (logcli).
|
||||
if (( ! $+commands[logcli] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `logcli`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_logcli" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _logcli
|
||||
_comps[logcli]=_logcli
|
||||
fi
|
||||
|
||||
zmodload -F zsh/files b:zf_mv
|
||||
() {
|
||||
local TMPPREFIX="$ZSH_CACHE_DIR/completions/._logcli"
|
||||
zf_mv -f -- =( logcli --completion-script-zsh ) "$ZSH_CACHE_DIR/completions/_logcli"
|
||||
} &|
|
||||
@@ -29,7 +29,7 @@ function pyuserpaths() {
|
||||
|
||||
# Get minor release version.
|
||||
# The patch version is variable length, truncate it.
|
||||
version=${(M)${"$($python -V 2>&1)":7}#[^.]##.[^.]##}
|
||||
version=${(M)${"$($python -V 2>&1)":7}##[^.]##.[^.]##}
|
||||
|
||||
# Add version specific path, if:
|
||||
# - it exists in the filesystem
|
||||
|
||||
@@ -14,5 +14,5 @@ fi
|
||||
zmodload -F zsh/files b:zf_mv
|
||||
() {
|
||||
local TMPPREFIX="$ZSH_CACHE_DIR/completions/._sops"
|
||||
zf_mv -f -- =( sops completions zsh ) "$ZSH_CACHE_DIR/completions/_sops"
|
||||
zf_mv -f -- =( sops completion zsh ) "$ZSH_CACHE_DIR/completions/_sops"
|
||||
} &|
|
||||
@@ -52,7 +52,7 @@ The plugin will generate a default archive filename based on the input:
|
||||
|
||||
| Format | Description | Tool Used |
|
||||
|:-----------------|:-------------------------------|:-----------------|
|
||||
| `7z` | 7zip archive | `7z` |
|
||||
| `7z` | 7zip archive | `7zz`,`7z`,`7za` |
|
||||
| `bz2` | Bzip2-compressed file | `bzip2` |
|
||||
| `gz` | Gzip-compressed file | `gzip` |
|
||||
| `lzma` | LZMA-compressed file | `lzma` |
|
||||
|
||||
@@ -49,7 +49,17 @@ tlz (tar.lzma), txz (tar.xz), tZ (tar.Z), xz, Z, zip, and zst."
|
||||
fi
|
||||
|
||||
case "$ext" in
|
||||
7z) 7z u "${output}" "${@}" ;;
|
||||
7z)
|
||||
if (( $+commands[7zz] )); then
|
||||
7zz u "${output}" "${@}"
|
||||
elif (( $+commands[7z] )); then
|
||||
7z u "${output}" "${@}"
|
||||
elif (( $+commands[7za] )); then
|
||||
7za u "${output}" "${@}"
|
||||
else
|
||||
echo "ua: cannot create 7z files: install 7zz, 7z or 7za" >&2
|
||||
return 1
|
||||
fi ;;
|
||||
bz2) bzip2 -vcf "${@}" > "${output}" ;;
|
||||
gz) gzip -vcf "${@}" > "${output}" ;;
|
||||
lzma) lzma -vc -T0 "${@}" > "${output}" ;;
|
||||
|
||||
+12
-1
@@ -38,6 +38,17 @@ Zsh-z is a drop-in replacement for `rupa/z` and will, by default, use the same d
|
||||
|
||||
## News
|
||||
|
||||
### v2.0.1 (October 1, 2026)
|
||||
|
||||
- **Database writes now work with `setopt NO_CLOBBER`.** Under `NO_CLOBBER`,
|
||||
every database write could fail with `can't clobber parameter tmpfd containing
|
||||
file descriptor 0`, even when the database already existed. That error no longer
|
||||
occurs ([#81](https://github.com/agkozak/zsh-z/issues/81)).
|
||||
- **Database and lockfile creation now works with `setopt NO_CLOBBER`.** With
|
||||
`NO_CLOBBER` set and `APPEND_CREATE` unset, Zsh-z could not create a missing
|
||||
database or lockfile. It now creates them without changing your shell options or
|
||||
losing existing directory history ([#105](https://github.com/agkozak/zsh-z/issues/105)).
|
||||
|
||||
### v2.0 (August 14, 2026)
|
||||
|
||||
Version **2.0** is a major step forward, and these are the changes most worth knowing about:
|
||||
@@ -47,7 +58,7 @@ Version **2.0** is a major step forward, and these are the changes most worth kn
|
||||
- **Safer, crash-resistant concurrent writes.** Writes are now guarded by a dedicated, stable lockfile using `zsh/system` file locking, with a bounded wait for lock acquisition (the new [`ZSHZ_LOCK_TIMEOUT`](#settings), default `1` second). Write errors are handled gracefully, and locks are always released even if a write is interrupted. On Cygwin and MSYS2 a write is also retried briefly if Windows refuses it: a virus scanner or the search indexer that opens the database in the instant between its being written and its being moved into place makes the move fail, which used to lose that one directory silently. Zsh-z now retries the move briefly.
|
||||
- **Your database file now has `600` permissions** -- readable and writable only by you -- so that other users on a shared system cannot read your directory history ([#92](https://github.com/agkozak/zsh-z/issues/92)). On Zsh 5+ this uses the in-process `zf_chmod` builtin; on Zsh 4.3.11 it uses a `umask`-in-a-subshell technique that avoids the fork-and-exec of an external `chmod`.
|
||||
- **`COMPLETE_ALIASES` works automatically in normal setups.** Tab completion no longer breaks when you have `setopt COMPLETE_ALIASES` enabled. Zsh-z registers the alias automatically on the first Tab press, so the manual `compdef` line that earlier versions required is no longer necessary. [See below](#complete_aliases).
|
||||
- **Fixed a `can't clobber parameter tmpfd` error on some Zsh builds.** On certain Zsh builds, every database write could fail with `can't clobber parameter tmpfd containing file descriptor 0`, leaving an error at each new prompt. The file descriptor used for the temporary database file is now held in an unset scalar rather than one seeded with `0`, so the write never trips Zsh's file-descriptor-clobber guard ([#81](https://github.com/agkozak/zsh-z/issues/81)).
|
||||
- **Fixed a `can't clobber parameter tmpfd` error on some Zsh builds.** On certain Zsh builds, every database write could fail with `can't clobber parameter tmpfd containing file descriptor 0`, leaving an error at each new prompt ([#81](https://github.com/agkozak/zsh-z/issues/81)). *Correction:* the error occurs under `setopt NO_CLOBBER`, and the v2.0 change did not fix it there; v2.0.1 does.
|
||||
- **A misconfigured database file no longer closes your shell -- or nags you at every prompt.** When `ZSHZ_DATA` points at a directory, or names a file without a directory, Zsh-z now reports the problem and returns instead of calling `exit`. The per-prompt `--add` stays quiet about it, so you are told once, when you actually run `z`, rather than at every prompt ([#103](https://github.com/agkozak/zsh-z/issues/103); props @ahjota).
|
||||
- **`z -x` can now remove the entry for a directory that no longer exists -- and can no longer crash Zsh 4.3.11.** The removal target used to have to exist on disk, so a database entry whose directory had been deleted -- exactly the entry you most want gone -- could not be removed. `z -x /deleted/dir` (and `z -xR`) now canonicalizes the argument without requiring it to exist, resolving symlinks in as much of the path as is still present. The same change fixes a crash on Zsh 4.3.11, where an upstream bug makes `${x:A}` segfault when the top-level component of the path is missing: `z -x /gone/sub` -- or a `ZSHZ_DATA` pointing into a missing top-level directory -- could kill the shell there.
|
||||
- **More robust startup and operation.** A version check on an unsupported Zsh no longer risks exiting your interactive shell.
|
||||
|
||||
+14
-13
@@ -371,16 +371,17 @@ zshz() {
|
||||
# before the lock is taken, and on Cygwin/MSYS2 a concurrent writer's rename
|
||||
# passes through a window in which the datafile is unlinked or delete-
|
||||
# pending, so any second syscall on the path (chmod) -- or even the creating
|
||||
# open itself -- can fail spuriously. Append mode (>>) creates the file
|
||||
# without truncating one that a concurrent writer has just renamed into
|
||||
# place. The first attempt is silent; if the file still does not exist
|
||||
# open itself -- can fail spuriously. Forced append redirection (>>|) creates
|
||||
# the file even under NO_CLOBBER with APPEND_CREATE disabled, without
|
||||
# truncating one that a concurrent writer has just renamed into place.
|
||||
# The first attempt is silent; if the file still does not exist
|
||||
# afterward (so no concurrent writer supplied it), retry loudly so that real
|
||||
# failures (directory permissions, read-only filesystem) reach the user.
|
||||
[[ -f $datafile ]] || {
|
||||
mkdir -p "${datafile:h}" &&
|
||||
( umask 077; : >> "$datafile" ) 2> /dev/null ||
|
||||
( umask 077; : >>| "$datafile" ) 2> /dev/null ||
|
||||
[[ -f $datafile ]] ||
|
||||
( umask 077; : >> "$datafile" )
|
||||
( umask 077; : >>| "$datafile" )
|
||||
# When $ZSHZ_OWNER is set (e.g. under `sudo -s'), hand the freshly created
|
||||
# file off to that user immediately, so a query-only invocation can't leave
|
||||
# behind a root-owned .z that the normal-user shell can't read. `-h' so a
|
||||
@@ -525,14 +526,14 @@ zshz() {
|
||||
# two-inodes race the stable lockfile exists to prevent.
|
||||
# Under $ZSHZ_OWNER all of this runs with root's authority on a path the
|
||||
# unprivileged owner controls, and every step follows a symlink: `-f'
|
||||
# tests the target, `>>' creates a dangling one, and flock opens it.
|
||||
# tests the target, `>>|' creates a dangling one, and flock opens it.
|
||||
# $datafile survives a planted link only because the `mv' below replaces
|
||||
# it outright; the lockfile is deliberately never removed, so a symlink
|
||||
# here would persist and be acted on at every subsequent write. Refuse.
|
||||
local _lock_owner=${ZSHZ_OWNER:-${_Z_OWNER}}
|
||||
[[ -n $_lock_owner && -L $lockfile ]] && return 1
|
||||
if [[ ! -f $lockfile ]]; then
|
||||
( umask 077; : >> "$lockfile" ) 2> /dev/null
|
||||
( umask 077; : >>| "$lockfile" ) 2> /dev/null
|
||||
[[ -n $_lock_owner ]] &&
|
||||
${ZSHZ[CHOWN]} -h "${_lock_owner}:$(id -ng "${_lock_owner}")" "$lockfile"
|
||||
fi
|
||||
@@ -585,13 +586,13 @@ zshz() {
|
||||
# Discard entries that are incomplete or incorrectly formatted
|
||||
lines=( ${(M)lines:#/*\|[[:digit:]]##[.,]#[[:digit:]]#\|[[:digit:]]##} )
|
||||
|
||||
# Hold the fd in an *unset* scalar, not `integer tmpfd' (which seeds it
|
||||
# with 0). On some Zsh builds, `exec {tmpfd}>|...' refuses to clobber a
|
||||
# parameter already holding a number that names an open fd -- and 0 is
|
||||
# stdin, always open -- yielding "can't clobber parameter tmpfd
|
||||
# containing file descriptor 0". An empty scalar isn't a valid fd, so
|
||||
# the guard never fires. See https://github.com/agkozak/zsh-z/issues/81
|
||||
# Explicitly unset the local scalar before allocating a file descriptor.
|
||||
# Under NO_CLOBBER, even an empty scalar can be treated as fd 0 (stdin),
|
||||
# causing `exec {tmpfd}>|...' to refuse to overwrite it. The `>|' only
|
||||
# overrides file clobber protection, not the descriptor parameter check.
|
||||
# See https://github.com/agkozak/zsh-z/issues/81
|
||||
local tmpfd
|
||||
unset tmpfd
|
||||
case $action in
|
||||
--add)
|
||||
# When zf_chmod isn't available (Zsh 4.3.11), avoid the
|
||||
|
||||
+76
-20
@@ -202,6 +202,52 @@ if is_tty; then
|
||||
RESET=$(printf '\033[0m')
|
||||
fi
|
||||
|
||||
# Logo lines, split by `|` into one segment per rainbow color
|
||||
BANNER=(
|
||||
' |__ | | | | |__ '
|
||||
' ____ |/ /_ | ____ ___ |__ __ | ____ |_____|/ /_ '
|
||||
' / __ \|/ __ \ | / __ `__ \|/ / / / | /_ / |/ ___/| __ \ '
|
||||
'/ /_/ /| / / / | / / / / / /| /_/ / | / /_|(__ )| / / / '
|
||||
'\____/|_/ /_/ | /_/ /_/ /_/|\__, / | /___/|____/|_/ /_/ '
|
||||
' | | | /____/ | | | '
|
||||
)
|
||||
|
||||
# Print the first $1 columns of the logo
|
||||
print_banner_frame() {
|
||||
local line i
|
||||
local -i remaining
|
||||
local -a segments
|
||||
for line in $BANNER; do
|
||||
remaining=$1
|
||||
segments=("${(@s:|:)line}")
|
||||
for (( i = 1; i <= $#segments && remaining > 0; i++ )); do
|
||||
printf '%s%s' "${RAINBOW[i]}" "${segments[i][1,remaining]}"
|
||||
(( remaining -= ${#segments[i]} ))
|
||||
done
|
||||
printf '%s\n' "$RESET"
|
||||
done
|
||||
}
|
||||
|
||||
# Draw the logo left to right on a terminal, all at once otherwise
|
||||
print_banner() {
|
||||
local -i width=${#${BANNER[2]//|}} step=4 col
|
||||
|
||||
if ! is_tty || ! zmodload zsh/zselect 2>/dev/null; then
|
||||
print_banner_frame $width
|
||||
return
|
||||
fi
|
||||
|
||||
printf '\033[?25l'
|
||||
for (( col = step; ; col += step )); do
|
||||
(( col > width )) && col=width
|
||||
print_banner_frame $col
|
||||
(( col == width )) && break
|
||||
printf '\033[%dA' $#BANNER
|
||||
zselect -t 2
|
||||
done
|
||||
printf '\033[?25h'
|
||||
}
|
||||
|
||||
# Update upstream remote to ohmyzsh org
|
||||
git remote -v | while read remote url extra; do
|
||||
case "$url" in
|
||||
@@ -232,9 +278,6 @@ git config core.autocrlf false
|
||||
git config fsck.zeroPaddedFilemode ignore
|
||||
git config fetch.fsck.zeroPaddedFilemode ignore
|
||||
git config receive.fsck.zeroPaddedFilemode ignore
|
||||
# autostash on rebase (#7172)
|
||||
resetAutoStash=$(git config --bool rebase.autoStash 2>/dev/null)
|
||||
git config rebase.autoStash true
|
||||
|
||||
local ret=0
|
||||
|
||||
@@ -242,6 +285,35 @@ local ret=0
|
||||
remote=${"$(git config --local oh-my-zsh.remote)":-origin}
|
||||
branch=${"$(git config --local oh-my-zsh.branch)":-master}
|
||||
|
||||
# repository state
|
||||
last_head=$(git symbolic-ref --quiet --short HEAD || git rev-parse HEAD)
|
||||
|
||||
# autostash on rebase (#7172)
|
||||
resetAutoStash=$(git config --bool rebase.autoStash 2>/dev/null)
|
||||
|
||||
# Runs on every exit, including ctrl-c and closing the terminal
|
||||
_omz_upgrade_cleanup() {
|
||||
trap '' INT TERM HUP
|
||||
|
||||
# show the cursor again if the logo animation hid it
|
||||
is_tty && printf '\033[?25h'
|
||||
|
||||
# go back to HEAD previous to update
|
||||
git checkout -q "$last_head" --
|
||||
|
||||
# Unset git-config values set just for the upgrade
|
||||
case "$resetAutoStash" in
|
||||
"") git config --unset rebase.autoStash ;;
|
||||
*) git config rebase.autoStash "$resetAutoStash" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
trap _omz_upgrade_cleanup EXIT
|
||||
trap 'exit 130' INT
|
||||
trap 'exit 143' TERM
|
||||
trap 'exit 129' HUP
|
||||
git config rebase.autoStash true
|
||||
|
||||
update_with_cooldown() {
|
||||
local cutoff_epoch cooldown_ref
|
||||
|
||||
@@ -264,8 +336,6 @@ perform_update() {
|
||||
fi
|
||||
}
|
||||
|
||||
# repository state
|
||||
last_head=$(git symbolic-ref --quiet --short HEAD || git rev-parse HEAD)
|
||||
# checkout update branch
|
||||
git checkout -q "$branch" -- || exit 1
|
||||
# branch commit before update (used in changelog)
|
||||
@@ -303,12 +373,7 @@ if perform_update; then
|
||||
fi
|
||||
|
||||
if [[ $verbose_mode == default ]]; then
|
||||
printf '%s %s__ %s %s %s %s %s__ %s\n' $RAINBOW $RESET
|
||||
printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $RAINBOW $RESET
|
||||
printf '%s / __ \\%s/ __ \\ %s / __ `__ \\%s/ / / / %s /_ / %s/ ___/%s __ \\ %s\n' $RAINBOW $RESET
|
||||
printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s / /_%s(__ )%s / / / %s\n' $RAINBOW $RESET
|
||||
printf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s /___/%s____/%s_/ /_/ %s\n' $RAINBOW $RESET
|
||||
printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET
|
||||
print_banner
|
||||
printf '\n'
|
||||
printf "${BLUE}%s${RESET}\n\n" "$message"
|
||||
printf "${BLUE}${BOLD}%s %s %s %s${RESET}\n" \
|
||||
@@ -331,14 +396,5 @@ else
|
||||
printf "${RED}%s${RESET}\n" 'There was an error updating. Try again later?'
|
||||
fi
|
||||
|
||||
# go back to HEAD previous to update
|
||||
git checkout -q "$last_head" --
|
||||
|
||||
# Unset git-config values set just for the upgrade
|
||||
case "$resetAutoStash" in
|
||||
"") git config --unset rebase.autoStash ;;
|
||||
*) git config rebase.autoStash "$resetAutoStash" ;;
|
||||
esac
|
||||
|
||||
# Exit with `1` if the update failed
|
||||
exit $ret
|
||||
Reference in new issue
Block a user