Page MenuHomePhabricator

Update "git rev-parse" invocation to work in Git 2.25.0
ClosedPublic

Authored by epriestley on Jan 16 2020, 7:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 20 2025, 8:41 PM
Unknown Object (File)
May 20 2025, 8:41 PM
Unknown Object (File)
May 20 2025, 8:40 PM
Unknown Object (File)
May 17 2025, 1:04 AM
Unknown Object (File)
May 5 2025, 11:29 PM
Unknown Object (File)
Apr 29 2025, 12:02 AM
Unknown Object (File)
Apr 23 2025, 1:50 PM
Unknown Object (File)
Apr 21 2025, 2:39 AM
Subscribers
None

Details

Summary

Fixes T13479. The behavior of "git rev-parse --show-toplevel" has changed in Git 2.25.0, and it now fails in bare repositories.

Instead, use "git rev-parse --git-dir" to sanity-check the working copy. This appears to have more stable behavior across Git versions, although it's a little more complicated for our purposes.

Test Plan
  • Ran bin/repository update ... on an observed, bare repository.
  • ...on an observed, non-bare ("legacy") repository.
  • ...on a hosted, bare repository.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Jan 16 2020, 7:38 PM
epriestley requested review of this revision.
This revision was automatically updated to reflect the committed changes.