Merged in tool_improvement (pull request #311)

RTM: make git_switch_linux switch to current branch if not specified
This commit is contained in:
Eric Harding authored and Pedro Pinto committed 2019-08-05 18:58:28 +00:00
commit ebe29fec00
1 file changed
+7 -4
+7 -4
View File
@@ -2,12 +2,15 @@
@setlocal
SETLOCAL
if "%SPARKVM_PORT%"=="" set SPARKVM_PORT=22
if "%1" == "" goto :err
if "%1" == "" (
for /F "tokens=2" %%m in ('git branch --points-at head') do set branch=%%m
) else (
set branch=%1
)
echo.
ssh bts@sparkvm -p %SPARKVM_PORT% -o StrictHostKeyChecking=no -t "cd /home/bts/spark ; git reset --hard ; git clean -fd ; git checkout %1 ; git pull ; git submodule update"
echo branch=%branch%
ssh bts@sparkvm -p %SPARKVM_PORT% -o StrictHostKeyChecking=no -t "cd /home/bts/spark ; git reset --hard ; git clean -fd ; git checkout %branch% ; git pull ; git submodule update"
ENDLOCAL
goto :eof
:err
echo usage git_switch_linux [branch]