summaryrefslogtreecommitdiff
path: root/setup.c
AgeCommit message (Collapse)AuthorFilesLines
2005-08-27[PATCH] Make .git directory validation code test HEADLibravatar Linus Torvalds1-11/+20
Inspired by a report by Kalle Valo, this changes git-sh-setup-script and the "setup_git_directory()" function to test that $GIT_DIR/HEAD is a symlink, since a number of core git features depend on that these days. We used to allow a regular file there, but git-fsck-cache has been complaining about that for a while, and anything that uses branches depends on the HEAD file being a symlink, so let's just encode that as a fundamental requirement. Before, a non-symlink HEAD file would appear to work, but have subtle bugs like not having the HEAD show up as a valid reference (because it wasn't under "refs"). Now, we will complain loudly, and the user can fix it up trivially instead of getting strange behaviour. This also removes the tests for "$GIT_DIR" and "$GIT_OBJECT_DIRECTORY" being directories, since the other tests will implicitly test for that anyway (ie the tests for HEAD, refs and 00 would fail). Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-17[PATCH] Export relative path handling "prefix_path()" functionLibravatar Linus Torvalds1-1/+1
Not all programs necessarily have a pathspec array of pathnames, some of them (like git-update-cache) want to do things one file at a time. So export the single-path interface too. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-16[PATCH] Improve handling of "." and ".." in git-diff-*Libravatar Linus Torvalds1-42/+51
This fixes up usage of ".." (without an ending slash) and "." (with or without the ending slash) in the git diff family. It also fixes pathspec matching for the case of an empty pathspec, since a "." in the top-level directory (or enough ".." under subdirectories) will result in an empty pathspec. We used to not match it against anything, but it should in fact match everything. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-16[PATCH] Fix test failure due to overly strict .git directory testsLibravatar Linus Torvalds1-3/+2
We may not actually have a valid HEAD at all times, so relax the validity tests for a .git subdirectory accordingly. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-16[PATCH] Make "git diff" work inside relative subdirectoriesLibravatar Linus Torvalds1-0/+110
We always show the diff as an absolute path, but pathnames to diff are taken relative to the current working directory (and if no pathnames are given, the default ends up being all of the current working directory). Note that "../xyz" also works, so you can do cd linux/drivers/char git diff ../block and it will generate a diff of the linux/drivers/block changes. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>