Page MenuHomePhabricator

Error when displaying a repository with only one empty commit
Closed, ResolvedPublic

Description

When a repository with only one empty commit is imported into diffusion, the following error is displayed:

Unable to Retrieve Paths
Expected "<mode> <type> <hash> <size>\t<name>", for ls-tree of "whateverthefirstsha1is:", got:

diff_error_empty_commit.png (81×1 px, 9 KB)

To reproduce the issue, create a git repository

git init
git checkout -b master
git remote add origin your_remote
git commit --allow-empty -m "First empty commit"
git push origin master

Then import it into diffusion.
The expected result is the previous error message

components versions:

phab : f59ebf4c09598e5f02657a4037c822b64a306646

libphutil: 0fa7efbf09d75b7803ef54bd6c72ee3c69a964e4

arcanist: aeb374b3334891d436334ac382bb63e2e4620c95

Revisions and Commits

Event Timeline

epriestley triaged this task as Wishlist priority.Jan 15 2016, 11:45 AM
epriestley added a subscriber: epriestley.

Thanks, those reproduction instructions are clear and I expect it will be straightforward for us to reproduce and fix this.

(A workaround is to make any commit so the repository has a tree, of course.)

@epriestley, Thanks, of course, adding any file to the next commit solves the problem.
By the way, it is a not a high priority bug since it does not broke the interface.

We are seeing this as well when attempting to browse an empty commit: https://phabricator.wikimedia.org/T140236

Needs a check for empty and at least a better error message in DiffusionBrowseQueryConduitAPIMethod.php:115