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)
Tue, Mar 12, 6:07 PM
Unknown Object (File)
Feb 22 2024, 8:53 PM
Unknown Object (File)
Feb 21 2024, 12:20 PM
Unknown Object (File)
Feb 11 2024, 10:58 PM
Unknown Object (File)
Feb 3 2024, 11:31 PM
Unknown Object (File)
Jan 16 2024, 9:05 AM
Unknown Object (File)
Jan 9 2024, 3:21 PM
Unknown Object (File)
Dec 23 2023, 2:33 PM
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.