Skip to content

Commit ecfd6af

Browse files
TEMP: Fix Windows test scripts to use current branch instead of main
The scripts now properly detect and pull from the current branch rather than always pulling from origin/HEAD (main). Reported-by: fweinberger
1 parent 033e7ed commit ecfd6af

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

run_windows_tests.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ echo ========================================
55
echo Pulling latest changes from remote...
66
echo ========================================
77

8+
REM Get the current branch name
9+
for /f "tokens=*" %%a in ('git rev-parse --abbrev-ref HEAD') do set CURRENT_BRANCH=%%a
10+
811
REM Force pull the current branch, discarding any local changes
9-
git fetch origin
10-
git reset --hard origin/HEAD
12+
git fetch origin %CURRENT_BRANCH%
13+
git reset --hard origin/%CURRENT_BRANCH%
1114

1215
echo.
1316
echo ========================================

run_windows_tests.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ Write-Host "========================================"
44
Write-Host "Pulling latest changes from remote..."
55
Write-Host "========================================"
66

7+
# Get the current branch name
8+
$currentBranch = git rev-parse --abbrev-ref HEAD
9+
710
# Force pull the current branch, discarding any local changes
8-
git fetch origin
9-
git reset --hard origin/HEAD
11+
git fetch origin $currentBranch
12+
git reset --hard origin/$currentBranch
1013

1114
Write-Host ""
1215
Write-Host "========================================"

0 commit comments

Comments
 (0)