Try to fix "git reference is not a tree" error.