Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions drupal-contrib/scripts/test-issue-branches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ for SPEC in "${TESTS[@]}"; do
continue
fi
log "Checked out issue branch: $BRANCH"
DIRTY=$(git status --short 2>/dev/null)
if [ -n "$DIRTY" ]; then
log "ERROR: dirty git tree after issue branch checkout:"
echo "$DIRTY" | head -20
RESULTS["$DIR_KEY"]="FAIL (dirty git tree after checkout)"
DURATIONS["$DIR_KEY"]=$((SECONDS - START))
cd "$HOME"
continue
fi
log "✓ git tree clean after checkout"
fi

# --- Configure DDEV if needed ---
Expand Down
6 changes: 6 additions & 0 deletions drupal-contrib/template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,12 @@ GIT_EXCLUDE_EOF
git checkout -b "$ISSUE_BRANCH" "$REMOTE_NAME/$ISSUE_BRANCH" >> "$SETUP_LOG" 2>&1; then
log_setup "✓ Checked out branch $ISSUE_BRANCH"
update_status "✓ Branch checkout: Success"
# Ensure working tree exactly matches the checked-out branch.
# origin/main may be ahead of the issue branch base; git can leave
# files from those newer commits as modified/untracked after checkout.
git reset --hard HEAD >> "$SETUP_LOG" 2>&1 || true
git clean -fd >> "$SETUP_LOG" 2>&1 || true
log_setup "✓ Working tree reset to match branch"
else
log_setup "⚠ Warning: Could not checkout $ISSUE_BRANCH — remaining on current branch"
update_status "⚠ Branch checkout: Warning"
Expand Down
10 changes: 10 additions & 0 deletions drupal-core/scripts/test-issue-branches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ for PAIR in "${TESTS[@]}"; do
cd "$HOME"
continue
fi
DIRTY=$(git status --short 2>/dev/null)
if [ -n "$DIRTY" ]; then
log "ERROR: dirty git tree after issue branch checkout:"
echo "$DIRTY" | head -20
RESULTS["$DIR_KEY"]="FAIL (dirty git tree after checkout)"
DURATIONS["$DIR_KEY"]=$((SECONDS - START))
cd "$HOME"
continue
fi
log "✓ git tree clean after checkout"
elif [ "$TARGET_BRANCH" != "main" ]; then
log "Checking out $TARGET_BRANCH..."
if ! (git checkout -b "$TARGET_BRANCH" "origin/$TARGET_BRANCH" 2>&1 || \
Expand Down
4 changes: 4 additions & 0 deletions drupal-core/scripts/update-drupal-cache
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ echo ""
echo "Fetching Drupal core git objects..."
git -C "$SEED_DIR" fetch --all --prune

echo "Fast-forwarding local main branch..."
git -C "$SEED_DIR" merge --ff-only origin/main || \
echo "Warning: could not fast-forward main (local changes?); objects still updated."

echo ""
echo "=== Seed cache updated successfully ==="
echo "Completed: $(date)"
Expand Down
7 changes: 7 additions & 0 deletions drupal-core/template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,13 @@ STATUS_HEADER
if git -C "$DRUPAL_DIR" checkout -b "$ISSUE_BRANCH" "issue/$ISSUE_BRANCH" >> "$SETUP_LOG" 2>&1 || \
git -C "$DRUPAL_DIR" checkout "$ISSUE_BRANCH" >> "$SETUP_LOG" 2>&1; then
log_setup " ✓ Checked out branch: $ISSUE_BRANCH"
# Ensure the working tree exactly matches the checked-out branch.
# When cloning with --reference, origin/main may be ahead of the
# issue branch base; git updates the index but can leave working tree
# files from those newer main commits behind as modified/untracked.
git -C "$DRUPAL_DIR" reset --hard HEAD >> "$SETUP_LOG" 2>&1 || true
git -C "$DRUPAL_DIR" clean -fd >> "$SETUP_LOG" 2>&1 || true
log_setup " ✓ Working tree reset to match branch"
else
log_setup "✗ Failed to check out branch $ISSUE_BRANCH"
SETUP_FAILED=true
Expand Down