SERVER-129083 Fix test_previous_release_tag suite failure on git less than 2.28

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2026-06-22
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The _init_repo helper calls Repo.init(repo, b="master") at line 34, which passes git init -b master under the hood. The -b flag to specify the initial branch name was introduced in Git 2.28; on older git versions the command fails with error: unknown switch 'b', causing every test in the suite to error out during setUp.

      Proposed solution: Make the -b usage conditional on the git version using Git().version_info >= (2, 28) (GitPython exposes this as a plain int tuple), falling back to r.git.symbolic_ref("HEAD", "refs/heads/master") on older git.

            Assignee:
            Tommaso Tocci
            Reporter:
            Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: