forked from glennsarti/dev-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetpr.bat
More file actions
36 lines (25 loc) · 705 Bytes
/
getpr.bat
File metadata and controls
36 lines (25 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@ECHO OFF
SETLOCAL
SET /P OWNER=Enter project owner (default - puppetlabs):
SET /P PROJECT=Enter project name (e.g. puppet):
SET /P BRANCH=Enter branch name (default - master):
SET /P PRNUM=Enter PR number (e.g. 12345):
if [%OWNER%] == [] (
SET BRANCH=puppetlabs
)
if [%BRANCH%] == [] (
SET BRANCH=master
)
SET REPO=%cd%\%PROJECT%-pr%PRNUM%
ECHO Cleaning...
RD /S /Q "%REPO%" > NUL
ECHO Cloning..
git clone https://github.com/%OWNER%/%PROJECT%.git "%REPO%"
PUSHD "%REPO%"
ECHO Fetching PR...
git fetch origin refs/pull/%PRNUM%/head:pr_%PRNUM%
ECHO Changing to intended branch...
git checkout %BRANCH%
ECHO Merging PR...
git merge pr_%PRNUM% --no-ff
POPD