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.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 8:32 PM
Unknown Object (File)
Oct 24 2024, 12:37 PM
Unknown Object (File)
Oct 22 2024, 1:41 AM
Unknown Object (File)
Oct 20 2024, 12:51 PM
Unknown Object (File)
Oct 9 2024, 10:23 AM
Unknown Object (File)
Oct 8 2024, 3:47 AM
Unknown Object (File)
Sep 9 2024, 10:48 PM
Unknown Object (File)
Aug 3 2024, 5:28 PM
Subscribers
Restricted Owners Package
Tokens
"Cup of Joe" token, awarded by jcox.

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
Branch
drydock1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 21027
Build 28564: Run Core Tests
Build 28563: arc lint + arc unit