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)
Thu, Apr 11, 8:13 AM
Unknown Object (File)
Sat, Apr 6, 8:18 PM
Unknown Object (File)
Fri, Mar 29, 9:58 AM
Unknown Object (File)
Fri, Mar 29, 8:41 AM
Unknown Object (File)
Thu, Mar 28, 1:08 PM
Unknown Object (File)
Mar 12 2024, 6:07 PM
Unknown Object (File)
Feb 22 2024, 8:53 PM
Unknown Object (File)
Feb 21 2024, 12:20 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.