From: Junio C Hamano Date: Sun, 27 Jul 2008 20:02:41 GMT Subject: Re: [PATCH 2/7] builtin-help: change the current directory back in list_commands_in_dir() Message-ID: <7vwsj7yu1q.fsf@gitster.siamese.dyndns.org> In-Reply-To: <4f2b03391e3f85cf2224f97a2a7765d08707bd73.1217037178.git.vmiklos@frugalware.org> Miklos Vajna writes: > That function used to do a chdir() without switching back to the > original directory. That was not a problem till this function was used > only inside builtin-help, but once other builtins use it as well, this > is a problem, for example when the object database path is relative. Why does it even need to chdir() around to begin with? Doesn't opendir() work just fine with relative path as an input?