From: Johannes Schindelin Date: Mon, 13 Mar 2017 20:09:44 +0000 (+0100) Subject: setup: prepare setup_discovered_git_dir() for the root directory X-Git-Tag: v2.13.0-rc0~100^2~9 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/df380d58ece2a745e4283ef4de8dfeea560546bb?hp=df380d58ece2a745e4283ef4de8dfeea560546bb setup: prepare setup_discovered_git_dir() for the root directory Currently, the offset parameter (indicating what part of the cwd parameter corresponds to the current directory after discovering the .git/ directory) is set to 0 when we are running in the root directory. However, in the next patches we will avoid changing the current working directory while searching for the .git/ directory, meaning that the offset corresponding to the root directory will have to be 1 to reflect that this directory is characterized by the path "/" (and not ""). So let's make sure that setup_discovered_git_directory() only tries to append the trailing slash to non-root directories. Note: the setup_bare_git_directory() does not need a corresponding change, as it does not want to return a prefix. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano ---