Move write_shallow_commits to fetch-pack.c