use xgetcwd() to set $GIT_DIR
commit999eb0156c5bb6cb79c91704fdbe2284bf1cd89e
authorRené Scharfe <l.s.r@web.de>
Mon, 28 Jul 2014 18:31:57 +0000 (28 20:31 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 Jul 2014 19:17:53 +0000 (29 12:17 -0700)
tree02da249a09147bc5a1846598399075eadc01d95f
parent7f5ba7f013376a473d76e230a4574465ea20695d
use xgetcwd() to set $GIT_DIR

Instead of dying of a segmentation fault if getcwd() returns NULL, use
xgetcwd() to make sure to write a useful error message and then exit
in an orderly fashion.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/init-db.c
git.c