mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +08:00
修复git reset
This commit is contained in:
parent
cb154437ac
commit
f0d2d57584
|
@ -316,15 +316,15 @@ git_pull_scripts() {
|
||||||
local dir_current=$(pwd)
|
local dir_current=$(pwd)
|
||||||
local dir_work="$1"
|
local dir_work="$1"
|
||||||
local branch="$2"
|
local branch="$2"
|
||||||
[[ $branch ]] && local part_cmd="origin/${branch}"
|
[[ $branch ]] && git checkout ${branch}
|
||||||
cd $dir_work
|
cd $dir_work
|
||||||
echo -e "开始更新仓库:$dir_work\n"
|
echo -e "开始更新仓库:$dir_work\n"
|
||||||
|
|
||||||
set_proxy
|
set_proxy
|
||||||
git fetch --all
|
git fetch --all
|
||||||
exit_status=$?
|
exit_status=$?
|
||||||
git reset --hard $part_cmd
|
git reset --hard &>/dev/null
|
||||||
git pull
|
git pull &>/dev/null
|
||||||
unset_proxy
|
unset_proxy
|
||||||
|
|
||||||
cd $dir_current
|
cd $dir_current
|
||||||
|
@ -341,8 +341,8 @@ reset_romote_url() {
|
||||||
if [[ -d "$dir_work/.git" ]]; then
|
if [[ -d "$dir_work/.git" ]]; then
|
||||||
cd $dir_work
|
cd $dir_work
|
||||||
[[ -f ".git/index.lock" ]] && rm -f .git/index.lock >/dev/null
|
[[ -f ".git/index.lock" ]] && rm -f .git/index.lock >/dev/null
|
||||||
git remote set-url origin $url >/dev/null
|
git remote set-url origin $url &>/dev/null
|
||||||
git reset --hard $part_cmd >/dev/null
|
git reset --hard $part_cmd &>/dev/null
|
||||||
cd $dir_current
|
cd $dir_current
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user