libgit2/tests/submodule
Patrick Steinhardt 2696c5c3ec repository: make check if repo is a worktree more strict
To determine if a repository is a worktree or not, we currently check
for the existence of a "gitdir" file inside of the repository's gitdir.
While this is sufficient for non-broken repositories, we have at least
one case of a subtly broken repository where there exists a gitdir file
inside of a gitmodule. This will cause us to misidentify the submodule
as a worktree.

While this is not really a fault of ours, we can do better here by
observing that a repository can only ever be a worktree iff its common
directory and dotgit directory are different. This allows us to make our
check whether a repo is a worktree or not more strict by doing a simple
string comparison of these two directories. This will also allow us to
do the right thing in the above case of a broken repository, as for
submodules these directories will be the same. At the same time, this
allows us to skip the `stat` check for the "gitdir" file for most
repositories.
2017-05-19 09:44:44 +02:00
..
add.c blob: fail to create a blob from a dir with EDIRECTORY 2015-07-12 12:11:22 +02:00
init.c submodule: make _set_url() affect the configuration 2015-06-22 17:02:55 +02:00
lookup.c Allow for caching of submodules. 2017-01-20 17:33:56 -05:00
modify.c submodule: test unsetting config options 2015-06-22 17:02:56 +02:00
nosubs.c submodule: completely remove reload_all 2015-07-01 17:49:07 +02:00
open.c repository: make check if repo is a worktree more strict 2017-05-19 09:44:44 +02:00
repository_init.c config: borrow refcounted references 2015-03-03 18:35:12 +01:00
status.c git_futils_mkdir_*: make a relative-to-base mkdir 2015-09-17 10:00:35 -04:00
submodule_helpers.c tests: provide better pass/failure error messages 2017-02-17 12:58:57 +00:00
submodule_helpers.h status: test submodules with mixed case 2016-03-31 17:58:43 -04:00
update.c submodule: test updating a submodule w/ a path 2015-11-04 16:53:41 -05:00