sdk_lib: Make git setup more robust.

In particular:
- Move git setup code from make_chroot to enter_chroot. Most of the user
  settings are copied in the enter_chroot script. This increases
  uniformity.
- Determine the location of gitcookies from the gitconfig file for the
  user.
- Update the gitconfig for the user inside the chroot to point to the
  copied gitcookies file.

BUG=chromium:465563
TEST=(1) From scratch, run `cros_sdk --create` and manually verify
         gitconfig, gitcookies, when
         (a) gitcookies doesn't exist.
         (b) gitcookies is at ${HOME}/.gitcookies
         (c) gitcookies is elsewhere with gitconfig pointing to it.
     (2) Run a clobber trybot to ensure sane chroot setup.

Change-Id: Ia7fb9a810c8968f7deb2d49367998b39fd3e8084
Reviewed-on: https://chromium-review.googlesource.com/259825
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
2 files changed