Configure git author name and git author email in .gitconfig.

If git author name is different in the chroot from outside the chroot, repo
may auto-delete your changes when you run repo sync. These changes can be
recovered, but their deletion is inconvenient.

BUG=chromium-os:5934
TEST=Check that git var GIT_COMMITTER_IDENT is now correct inside chroot.

Change-Id: I622cd37caa404a7482c55c4b3984877b32b3807c

Review URL: http://codereview.chromium.org/3352008
This commit is contained in:
David James 2010-09-27 10:04:57 -07:00
parent 70b297a263
commit 0fd8af4a9b

View File

@ -285,6 +285,12 @@ if [ -d "$HOME/.subversion" ]; then
fi
fi
# Configure committer username and email in chroot .gitconfig
git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all user.name \
"$(cd /tmp; git var GIT_COMMITTER_IDENT | sed -e 's/ *<.*//')"
git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all user.email \
"$(cd /tmp; git var GIT_COMMITTER_IDENT | sed -e 's/.*<\([^>]*\)>.*/\1/')"
# Run command or interactive shell. Also include the non-chrooted path to
# the source trunk for scripts that may need to print it (e.g.
# build_image.sh).