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
F15369817: D20945.diff
Wed, Mar 12, 8:15 AM
F15337090: D20945.id49905.diff
Sun, Mar 9, 4:01 AM
Unknown Object (File)
Mon, Feb 24, 5:02 AM
Unknown Object (File)
Feb 9 2025, 8:31 AM
Unknown Object (File)
Feb 9 2025, 8:31 AM
Unknown Object (File)
Feb 9 2025, 8:31 AM
Unknown Object (File)
Jan 29 2025, 6:56 PM
Unknown Object (File)
Jan 25 2025, 6:19 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.