enter_chroot: handle older git versions

The --type=path option was added in git-2.18.0 (Jun 2018), and not
everyone keeps their system up-to-date.  Use --type=path only when
we detect that ~ is being used so we support old/new versions well.

BUG=chromium:1025578
TEST=`cros_sdk` copies in gitcookies now

Change-Id: I78741332f19fefa89869a4216769c0fab7f62abe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/1966379
Reviewed-by: Sean Abraham <seanabraham@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
1 file changed