environment.c: fix incorrect git_graft_file initialization
commit80015ab17860e665325ac6392a03bfb42aa069be
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Tue, 29 Jul 2014 13:50:29 +0000 (29 20:50 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 Jul 2014 20:42:14 +0000 (29 13:42 -0700)
tree791c7a703614f51a9696eefc448d9cdf23be487d
parente1cb70dca81a97bb6dd9198923f5808c9031844b
environment.c: fix incorrect git_graft_file initialization

"info/grafts" should be part of the "common repository" when accessed
from a linked checkout (iow $GIT_COMMON_DIR/info/grafts, not
$GIT_DIR/info/grafts).

git_path("info/grafts") returns correctly, even without this fix,
because it detects that $GIT_GRAFT_FILE is not set, so it goes with the
common rule: anything except sparse-checkout in 'info' belongs to common
repo. But get_graft_file() would return a wrong value and that one is
used for setting grafts up.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
environment.c
t/t0060-path-utils.sh
t/t2025-checkout-to.sh