Page MenuHomePhabricator

Don't try to prune unreachable commits from repositories with no outdated refs
ClosedPublic

Authored by epriestley on Jul 5 2016, 3:30 PM.
Tags
None
Referenced Files
F14359465: D16234.diff
Fri, Dec 20, 9:25 AM
Unknown Object (File)
Sat, Dec 14, 10:20 PM
Unknown Object (File)
Oct 18 2024, 7:57 AM
Unknown Object (File)
Oct 17 2024, 2:15 PM
Unknown Object (File)
Oct 11 2024, 1:22 AM
Unknown Object (File)
Oct 11 2024, 1:22 AM
Unknown Object (File)
Oct 11 2024, 1:21 AM
Unknown Object (File)
Oct 11 2024, 1:02 AM
Subscribers
None

Details

Summary

Fixes T11269. The basic issue is that git log in an empty repository exits with an error message.

Prior to recent Git (2.6?), this message reads:

fatal: bad default revision 'HEAD'

This message was somewhat recently changed by https://github.com/git/git/commit/ce113604672fed9b429b1c162b1005794fff6a17. After that, it reads:

fatal: your current branch 'master' does not have any commits yet

This change isn't technically a complete fix because you could still hit this issue like this:

  • Create an empty repository.
  • Push some stuff to master.
  • Delete master.

However, this is very rare and even in this case the repository will fix itself once you push something again. We can try to fix that if any users ever actually hit it.

Test Plan
  • Created a new empty Git repository.
  • Ran bin/repository update Rxx.
  • Before patch: "git log" error because of the empty repository.
  • After patch: clean update.
  • Also ran repository update on a non-empty repository.

Diff Detail

Repository
rP Phabricator
Branch
empty
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 12930
Build 16499: Run Core Tests
Build 16498: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to Don't try to prune unreachable commits from repositories with no refs.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
epriestley retitled this revision from Don't try to prune unreachable commits from repositories with no refs to Don't try to prune unreachable commits from repositories with no outdated refs.Jul 5 2016, 3:31 PM

Failed unit test, but doesn't seem related.

chad edited edge metadata.
This revision is now accepted and ready to land.Jul 5 2016, 3:56 PM
This revision was automatically updated to reflect the committed changes.