girt 0.18.0

An incremental, idiomatic Rust implementation of Git
Documentation
name: References

# CI calls this workflow for pushes and pull requests that touch its paths.
on:
  workflow_call:
    inputs:
      full:
        description: Include macOS and Windows coverage
        type: boolean
        default: true
  workflow_dispatch:
    inputs:
      reflog_only:
        description: Run focused imported reflog acceptance and resource checks
        type: boolean
        default: false
      reftable_only:
        description: Run focused reftable acceptance and resource checks
        type: boolean
        default: false

permissions:
  contents: read

jobs:
  references:
    name: References (${{ matrix.os }})
    if: ${{ !inputs.reftable_only && !inputs.reflog_only }}
    strategy:
      fail-fast: false
      matrix:
        os: ${{ (github.event_name == 'workflow_dispatch' || inputs.full) && fromJSON('["ubuntu-26.04", "macos-14", "windows-2022"]') || fromJSON('["ubuntu-26.04"]') }}
    runs-on: ${{ matrix.os }}
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Toolchain
        run: |
          rustup toolchain install stable --profile minimal --component clippy
          rustc +stable -Vv
          git --version
      - name: Rust cache
        uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
        env:
          RUSTUP_TOOLCHAIN: stable
        with:
          shared-key: stable-area
          cache-on-failure: true
          save-if: ${{ github.ref == 'refs/heads/main' }}
      - name: Unix filesystem
        if: runner.os != 'Windows'
        run: |
          uname -a
          df . "$(python3 -c 'import tempfile; print(tempfile.gettempdir())')"
          if [ "$RUNNER_OS" = Linux ]; then
            df -T . "$(python3 -c 'import tempfile; print(tempfile.gettempdir())')"
          else
            sw_vers
            diskutil info "$(df . | tail -1 | awk '{print $1}')"
          fi
      - name: Windows filesystem
        if: runner.os == 'Windows'
        run: |
          Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber | ConvertTo-Json -Compress
          Get-Volume | Where-Object DriveLetter | Select-Object DriveLetter, FileSystem, FileSystemLabel | ConvertTo-Json -Compress
          Write-Output "Temporary directory: $env:TEMP"
      - name: Core reference and fault tests
        run: "cargo +stable test --locked --no-default-features --lib refs::"
      - name: Both-format Git interoperability
        run: cargo +stable test --locked --no-default-features --test references_portable --test worktree_create --test worktree_admin
      - name: Reference tests with tracing
        run: "cargo +stable test --locked --no-default-features --features tracing --lib refs::"
      - name: Public workflow
        run: cargo +stable run --locked --no-default-features --example reference_transaction
      - name: Clippy
        run: cargo +stable clippy --locked --no-default-features --lib --test references_portable --test worktree_create --test worktree_admin --example reference_transaction -- -D warnings

  reftable:
    name: Reftable (${{ matrix.os }})
    if: ${{ inputs.reftable_only }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-26.04, macos-14, windows-2022]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 25
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Environment
        run: |
          rustup toolchain install stable --profile minimal --component clippy
          rustc +stable -Vv
          git --version
          python -c "import platform,tempfile; print(platform.platform()); print(tempfile.gettempdir())"
      - name: Rust cache
        uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
        env:
          RUSTUP_TOOLCHAIN: stable
        with:
          shared-key: stable-area
          cache-on-failure: true
          save-if: ${{ github.ref == 'refs/heads/main' }}
      - name: Reference codec, stack, race and fault cases
        run: "cargo +stable test --locked --all-features --lib refs::"
      - name: Repository and public backend workflows
        run: cargo +stable test --locked --all-features --test reftable --test repositories --test references_portable --test colocation
      - name: Scoped Clippy
        run: cargo +stable clippy --locked --all-features --lib --test reftable --test repositories --test references_portable --test colocation --example reftable_resources --bench reftable -- -D warnings
      - name: Build isolated resource probe
        run: cargo +stable build --locked --release --example reftable_resources
      - name: Owned snapshot and compaction resources
        run: python tests/fixtures/reftable/measure.py
      - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
        if: always()
        with:
          name: reftable-${{ matrix.os }}
          path: reftable-resources.json

  imported-reflogs:
    name: Imported reflogs (${{ matrix.os }})
    if: ${{ inputs.reflog_only }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-26.04, macos-14, windows-2022]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 25
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Environment
        run: |
          rustup toolchain install stable --profile minimal --component clippy
          rustc +stable -Vv
          git --version
          python -c "import platform,tempfile; print(platform.platform()); print(tempfile.gettempdir())"
      - name: Rust cache
        uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
        env:
          RUSTUP_TOOLCHAIN: stable
        with:
          shared-key: stable-area
          cache-on-failure: true
          save-if: ${{ github.ref == 'refs/heads/main' }}
      - name: Reference parsing, publication and fault cases
        run: "cargo +stable test --locked --no-default-features --lib refs::"
      - name: Imported history and composed workflows
        run: cargo +stable test --locked --no-default-features --test imported_reflogs --test references_portable --test reftable --test colocation
      - name: Reference operations with tracing
        run: "cargo +stable test --locked --no-default-features --features tracing --lib refs::"
      - name: Imported history with tracing
        run: cargo +stable test --locked --no-default-features --features tracing --test imported_reflogs
      - name: Scoped Clippy
        run: cargo +stable clippy --locked --no-default-features --lib --test imported_reflogs --test references_portable --test reftable --test colocation --example reflog_resources -- -D warnings
      - name: Build resource probe
        run: cargo +stable build --locked --release --no-default-features --example reflog_resources
      - name: Resource observations
        run: cargo +stable run --locked --release --no-default-features --example reflog_resources
      - name: Git operation observations
        run: python tests/fixtures/reflogs/observe.py
      - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
        with:
          name: imported-reflogs-${{ matrix.os }}
          path: reflog-observations.json