Pack all the loose references in the repository
This method will load into the cache all the loose
references on the repository and update the
packed-refs
file with them.
Once the packed-refs
file has been written properly,
the loose references will be removed from disk.
WARNING: calling this method may invalidate any existing references previously loaded on the cache.
0 on success; error code otherwise