author | Johan Herland <johan@herland.net> | |
Tue, 26 Jan 2010 15:02:16 +0000 (16:02 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 26 Jan 2010 19:20:06 +0000 (11:20 -0800) | ||
commit | 65807ee697a28cb30b8ad38ebb8b84cebd3f255d | |
tree | 72a223d1ca8f37f463c7f21e61b92504c924f151 | tree | snapshot |
parent | e276f018f2c1f0fc962fbe44a36708d1cdebada8 | commit | diff |
builtin-config: Fix crash when using "-f <relative path>" from non-root dir
When your current directory is not at the root of the working tree, and you
use the "-f" option with a relative path, the current code tries to read
from a wrong file, since argv[2] is now beyond the end of the rearranged
argument list.
This patch replaces the incorrect argv[2] with the variable holding the
given config file name.
The bug was introduced by d64ec16 (git config: reorganize to use parseopt).
[jc: added test]
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When your current directory is not at the root of the working tree, and you
use the "-f" option with a relative path, the current code tries to read
from a wrong file, since argv[2] is now beyond the end of the rearranged
argument list.
This patch replaces the incorrect argv[2] with the variable holding the
given config file name.
The bug was introduced by d64ec16 (git config: reorganize to use parseopt).
[jc: added test]
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-config.c | diff | blob | history | |
t/t1300-repo-config.sh | diff | blob | history |