mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-03 21:43:18 +00:00 
			
		
		
		
	* tools: Add script to fetch-pull-request. Improves #397. * tools: Add script to fetch-rebase-pull-request. Improves #397.
		
			
				
	
	
		
			18 lines
		
	
	
		
			392 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			392 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/bash
 | 
						|
set -e
 | 
						|
set -x
 | 
						|
 | 
						|
if ! git diff-index --quiet HEAD; then
 | 
						|
    set +x
 | 
						|
    echo "There are uncommitted changes:"
 | 
						|
    git status --short
 | 
						|
    echo "Doing nothing to avoid losing your work."
 | 
						|
    exit 1
 | 
						|
fi
 | 
						|
request_id="$1"
 | 
						|
remote=${2:-"upstream"}
 | 
						|
git fetch "$remote" "pull/$request_id/head"
 | 
						|
git checkout -B "review-${request_id}" $remote/master
 | 
						|
git reset --hard FETCH_HEAD
 | 
						|
git pull --rebase
 |