mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-18 05:40:07 +00:00
simplify and speed up gitstatus/pull-upstream.zsh
This commit is contained in:
parent
ad48c1e77a
commit
b73042cf43
1 changed files with 4 additions and 6 deletions
|
@ -9,10 +9,10 @@ setopt err_exit no_unset pipe_fail extended_glob xtrace
|
|||
readonly GITSTATUS_DIR GITSTATUS_URL
|
||||
readonly -a IGNORE=(pull-upstream.zsh README.md)
|
||||
|
||||
function pull() {
|
||||
local repo && repo=$(mktemp -d ${TMPDIR:-/tmp}/gitstatus-pull-upstream.XXXXXXXXXX)
|
||||
() {
|
||||
local repo && repo="$(mktemp -d ${TMPDIR:-/tmp}/gitstatus-pull-upstream.XXXXXXXXXX)"
|
||||
trap "rm -rf ${(q)repo}" EXIT
|
||||
git clone $GITSTATUS_URL $repo
|
||||
git clone --depth 1 --single-branch $GITSTATUS_URL $repo
|
||||
|
||||
local dst
|
||||
for dst in $GITSTATUS_DIR/**/*(.,@); do
|
||||
|
@ -22,9 +22,7 @@ function pull() {
|
|||
[[ -f $src ]] && {
|
||||
mkdir -p ${dst:h} && cp -f $src $dst || return
|
||||
} || {
|
||||
rm $dst
|
||||
rm -f $dst
|
||||
}
|
||||
done
|
||||
}
|
||||
|
||||
pull
|
||||
|
|
Loading…
Reference in a new issue