author | Jeff King <peff@peff.net> | |
Mon, 28 Jul 2008 06:02:04 +0000 (02:02 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 2 Aug 2008 05:41:07 +0000 (22:41 -0700) | ||
commit | d65d2b2fb44a8bc0fc917aaca973ab7ad14d13b4 | |
tree | ba28d620693bbf0e0c545bbcd070d445b9df6ef8 | tree | snapshot |
parent | 1e5f7add985dbccc0e811dbb6eff5047d8843118 | commit | diff |
init: handle empty "template" parameter
If a user passes "--template=", then our template parameter
is blank. Unfortunately, copy_templates() assumes it has at
least one character, and does all sorts of bad things like
reading from template[-1] and then proceeding to link all of
'/' into the .git directory.
This patch just checks for that condition in copy_templates
and aborts. As a side effect, this means that --template=
now has the meaning "don't copy any templates."
Signed-off-by: Junio C Hamano <gitster@pobox.com>
If a user passes "--template=", then our template parameter
is blank. Unfortunately, copy_templates() assumes it has at
least one character, and does all sorts of bad things like
reading from template[-1] and then proceeding to link all of
'/' into the .git directory.
This patch just checks for that condition in copy_templates
and aborts. As a side effect, this means that --template=
now has the meaning "don't copy any templates."
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-init-db.c | diff | blob | history | |
t/t0001-init.sh | diff | blob | history |