Avoid publishing empty branches

Refs that point to the empty commit should not be synced in push/pull
Merge pull request #680 from dwins/no-null-refs-in-push-and-pull

Avoid publishing empty branches