make git_switch_linux switch to current branch if not specified

This commit is contained in:
Eric Harding committed 2019-08-05 14:54:05 -04:00
1 parent 7476b40bf1
commit aee344fc2c
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]