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)
Mon, Nov 18, 6:21 PM
Unknown Object (File)
Thu, Oct 31, 2:38 AM
Unknown Object (File)
Oct 21 2024, 8:10 PM
Unknown Object (File)
Sep 21 2024, 2:34 AM
Unknown Object (File)
Sep 20 2024, 11:22 PM
Unknown Object (File)
Aug 29 2024, 1:41 PM
Unknown Object (File)
Aug 28 2024, 8:56 AM
Unknown Object (File)
Aug 27 2024, 12:15 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.