mirror of
				https://github.com/whyour/qinglong.git
				synced 2025-11-04 19:47:37 +08:00 
			
		
		
		
	修改重置分支shell
This commit is contained in:
		
							parent
							
								
									6f2e7b9459
								
							
						
					
					
						commit
						f6dc0e020f
					
				| 
						 | 
				
			
			@ -324,8 +324,9 @@ git_pull_scripts() {
 | 
			
		|||
    set_proxy
 | 
			
		||||
    git fetch --all
 | 
			
		||||
    exit_status=$?
 | 
			
		||||
    git pull --allow-unrelated-histories
 | 
			
		||||
    git pull &>/dev/null
 | 
			
		||||
    unset_proxy
 | 
			
		||||
    reset_branch "$branch"
 | 
			
		||||
 | 
			
		||||
    cd $dir_current
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -342,16 +343,21 @@ reset_romote_url() {
 | 
			
		|||
        git remote set-url origin $url &>/dev/null
 | 
			
		||||
 | 
			
		||||
        local part_cmd=""
 | 
			
		||||
        if [[ $branch ]]; then
 | 
			
		||||
            part_cmd="origin/${branch}"
 | 
			
		||||
            git checkout -B "$branch"
 | 
			
		||||
            git branch --set-upstream-to=$part_cmd $branch
 | 
			
		||||
        fi
 | 
			
		||||
        git reset --hard $part_cmd &>/dev/null
 | 
			
		||||
        reset_branch "$branch"
 | 
			
		||||
        cd $dir_current
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
reset_branch() {
 | 
			
		||||
    local branch="$1"
 | 
			
		||||
    if [[ $branch ]]; then
 | 
			
		||||
        part_cmd="origin/${branch}"
 | 
			
		||||
        git checkout -B "$branch"
 | 
			
		||||
        git branch --set-upstream-to=$part_cmd $branch
 | 
			
		||||
    fi
 | 
			
		||||
    git reset --hard $part_cmd &>/dev/null
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
random_range() {
 | 
			
		||||
    local beg=$1
 | 
			
		||||
    local end=$2
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user