gitconfig: Improve robustness when blobs aren't present

With no blobs present the 'make gitconfig' target failed when
trying to add a file to a directory which doesn't exist.
Only try to deal with blobs if they're around.

Change-Id: I27ed33e2e22bb1571bc73fe55cf45aa1e2310bf1
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10806
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
This commit is contained in:
Patrick Georgi 2015-07-06 09:31:42 +00:00 committed by Stefan Reinauer
parent 9d6a17b549
commit 11ac97bb2b
1 changed files with 5 additions and 4 deletions

View File

@ -426,10 +426,11 @@ gitconfig:
fi; \
done
# Now set up thehooks for 3rdparty/blobs
if [ util/gitconfig/commit-msg -nt .git/modules/3rdparty/hooks/commit-msg -o \
! -x .git/modules/3rdparty/hooks/commit-msg ]; then \
sed -e "s,%MAKE%,$(MAKE),g" util/gitconfig/commit-msg > .git/modules/3rdparty/hooks/commit-msg; \
chmod +x .git/modules/3rdparty/hooks/commit-msg; \
if [ -d .git/modules/3rdparty -a \
\( util/gitconfig/commit-msg -nt .git/modules/3rdparty/hooks/commit-msg -o \
! -x .git/modules/3rdparty/hooks/commit-msg \) ]; then \
sed -e "s,%MAKE%,$(MAKE),g" util/gitconfig/commit-msg > .git/modules/3rdparty/hooks/commit-msg; \
chmod +x .git/modules/3rdparty/hooks/commit-msg; \
fi
[ -d 3rdparty/blobs ] && cd 3rdparty/blobs && git config remote.origin.push HEAD:refs/for/master
git config remote.origin.push HEAD:refs/for/master