author | Junio C Hamano <junkio@cox.net> | |
Fri, 25 Nov 2005 23:43:41 +0000 (15:43 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 25 Nov 2005 23:43:41 +0000 (15:43 -0800) | ||
commit | 5e7bfe256755ef2862e960864db1edb829c82b77 | |
tree | 4015ea6443610bdf69724975fbc520c18b1bdcac | tree | snapshot |
parent | 5d318ce6a9fb18448e4a1a9b61d355d391ddc5ec | commit | diff |
setup_git_directory: make sure GIT_DIR is a valid repository.
setup_git_directory() always trusted what the user told where
GIT_DIR was, and assumed that is a valid .git/ directory. This
commit changes it to at least do the same level validation as
is_toplevel_directory() does -- has refs/, has objects/ unless
GIT_OBJECT_DIRECTORY is set, and has valid HEAD symlink or
symref.
Signed-off-by: Junio C Hamano <junkio@cox.net>
setup_git_directory() always trusted what the user told where
GIT_DIR was, and assumed that is a valid .git/ directory. This
commit changes it to at least do the same level validation as
is_toplevel_directory() does -- has refs/, has objects/ unless
GIT_OBJECT_DIRECTORY is set, and has valid HEAD symlink or
symref.
Signed-off-by: Junio C Hamano <junkio@cox.net>
setup.c | diff | blob | history |