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
F15574071: D20945.diff
Mon, May 5, 11:29 PM
F15557933: D20945.diff
Tue, Apr 29, 12:02 AM
F15531920: D20945.id49905.diff
Wed, Apr 23, 1:50 PM
F15523634: D20945.id49905.diff
Mon, Apr 21, 2:39 AM
F15502112: D20945.diff
Sun, Apr 13, 10:42 PM
F15483752: D20945.id.diff
Apr 9 2025, 2:13 PM
F15423943: D20945.id49905.diff
Mar 22 2025, 7:35 PM
F15380214: D20945.id.diff
Mar 14 2025, 2:04 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.