index 8bb7b10174fdb24f2a028d6404224109c600b7ca..cc3fb380c1f3471f0371ba54ca2f338f90a8d4fc 100644 (file)
--- a/setup.c
+++ b/setup.c
work_tree = get_git_work_tree();
git_dir = get_git_dir();
if (!is_absolute_path(git_dir))
- set_git_dir(make_absolute_path(git_dir));
+ git_dir = make_absolute_path(git_dir);
if (!work_tree || chdir(work_tree))
die("This operation must be run in a work tree");
+ set_git_dir(make_relative_path(git_dir, work_tree));
initialized = 1;
}