Page MenuHomePhabricator

When leasing a Working Copy in Drydock, just "git reset --hard" so empty repositories work
ClosedPublic

Authored by epriestley on Oct 24 2018, 1:11 PM.

Details

Summary

Ref T13210. We currently "git reset --hard HEAD" during working copy leasing, mostly by convention/familiarity.

However, this command does not work in an empty repository, because there is no HEAD yet.

The command "git reset --hard" appears to have the same meaning and effect in all cases, except that it also works correctly in an empty repository.

The manual suggests that omitting HEAD should be the same as specifying HEAD, too:

The <tree-ish>/<commit> defaults to HEAD in all forms.

Test Plan

Successfully leased a working copy for an empty repository using Drydock.

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Oct 24 2018, 1:11 PM
Owners added a subscriber: Restricted Owners Package.Oct 24 2018, 1:11 PM
epriestley requested review of this revision.Oct 24 2018, 1:12 PM
amckinley accepted this revision.Oct 24 2018, 3:03 PM
This revision is now accepted and ready to land.Oct 24 2018, 3:03 PM
jcox awarded a token.Oct 24 2018, 3:29 PM
This revision was automatically updated to reflect the committed changes.