- 20 Jul, 2019 2 commits
-
-
When initializing a repository, we need to check whether its working directory supports symlinks to correctly set the initial value of the "core.symlinks" config variable. The code to check the filesystem is reusable in other parts of our codebase, like for example in our tests to determine whether certain tests can be expected to succeed or not. Extract the code into a new function `git_path_supports_symlinks` to avoid duplicate implementations. Remove a duplicate implementation in the repo test helper code.
Patrick Steinhardt committed -
Our file utils functions all have a "futils" prefix, e.g. `git_futils_touch`. One would thus naturally guess that their definitions and implementation would live in files "futils.h" and "futils.c", respectively, but in fact they live in "fileops.h". Rename the files to match expectations.
Patrick Steinhardt committed
-
- 19 Jul, 2019 1 commit
-
-
There's quite a lot of supporting code for our templates and they are an obvious standalone feature. Thus, let's extract those tests into their own suite to also make refactoring of them easier.
Patrick Steinhardt committed
-
- 11 Jul, 2019 1 commit
-
-
In commit 45f24e78 (git_repository_init: stop traversing at windows root, 2019-04-12), we have fixed `git_futils_mkdir` to correctly handle the case where we create a directory in Windows-style filesystem roots like "C:\repo". The problem here is an off-by-one: previously, to that commit, we've been checking wether the parent directory's length is equal to the root directory's length incremented by one. When we call the function with "/example", then the parent directory's length ("/") is 1, but the root directory offset is 0 as the path is directly rooted without a drive prefix. This resulted in `1 == 0 + 1`, which was true. With the change, we've stopped incrementing the root directory length, and thus now compare `1 <= 0`, which is false. The previous way of doing it was kind of finicky any non-obvious, which is also why the error was introduced. So instead of just re-adding the increment, let's explicitly add a condition that aborts finding the parent if the current parent path is "/". Making this change causes Azure Pipelines to fail the testcase repo::init::nonexistent_paths on Unix-based systems. This is because we have just fixed creating directories in the filesystem root, which previously didn't work. As Docker-based tests are running as root user, we are thus able to create the non-existing path and will now succeed to create the repository that was expected to actually fail. Let's split this up into three different tests: - A test to verify that we do not create repos in a non-existing parent directoy if the flag `GIT_REPOSITORY_INIT_MKPATH` is not set. - A test to verify that we fail if the root directory does not exist. As there is a common root directory on Unix-based systems that always exist, we can only test for this on Windows-based systems. - A test to verify that we fail if trying to create a repository in an unwriteable parent directory. We can only test this if not running tests as root user, as CAP_DAC_OVERRIDE will cause us to ignore permissions when creating files.
Patrick Steinhardt committed
-
- 17 Apr, 2019 1 commit
-
-
Stop traversing the filesystem at the Windows directory root. We were calculating the filesystem root for the given directory to create, and walking up the filesystem hierarchy. We intended to stop when the traversal path length is equal to the root path length (ie, stopping at the root, since no path may be shorter than the root path). However, on Windows, the root path may be specified in two different ways, as either `Z:` or `Z:\`, where `Z:` is the current drive letter. `git_path_dirname_r` returns the path _without_ a trailing slash, even for the Windows root. As a result, during traversal, we need to test that the traversal path is _less than or equal to_ the root path length to determine if we've hit the root to ensure that we stop when our traversal path is `Z:` and our calculated root path was `Z:\`.
Edward Thomson committed
-
- 17 Jan, 2019 1 commit
-
-
Update internal usage to use the `git_reference` names for constants.
Edward Thomson committed
-
- 20 Oct, 2018 4 commits
-
-
Test updated symbolic link creation on Windows. Ensure that we emulate Git for Windows behavior. Ensure that when `core.symlinks=true` is set in a global configuration that new repositories are created without a `core.symlinks` setting, and that when `core.symlinks` is unset that `core.symlinks=false` in set in the repository. Further ensure that checkout honors the expected `core.symlinks` defaults on Windows.
Edward Thomson committed -
Provide a function that allows tests to set up a bespoke global configuration path.
Edward Thomson committed -
Edward Thomson committed
-
Ensure that `core.symlinks` is set correctly. By default, it is unset, but it is explicitly set to `false` if the platform was detected to not support symlinks during repository initialization.
Edward Thomson committed
-
- 10 Jun, 2018 1 commit
-
-
Patrick Steinhardt committed
-
- 12 Nov, 2017 1 commit
-
-
Christine Poerschke committed
-
- 17 Jun, 2017 1 commit
-
-
Ariel Davis committed
-
- 27 Dec, 2015 3 commits
-
-
Include dotfiles when copying template directory, which will handle both a template directory itself that begins with a dotfile, and any dotfiles inside the directory.
Edward Thomson committed -
Ensure that we can handle template directories that begin with a leading dot.
Edward Thomson committed -
Ensure that `git_repository_init` honors the `init.templatedir` configuration setting.
Edward Thomson committed
-
- 17 Sep, 2015 1 commit
-
-
Untangle git_futils_mkdir from git_futils_mkdir_ext - the latter assumes that we own everything beneath the base, as if it were being called with a base of the repository or working directory, and is tailored towards checkout and ensuring that there is no bogosity beneath the base that must be cleaned up. This is (at best) slow and (at worst) unsafe in the larger context of a filesystem where we do not own things and cannot do things like unlink symlinks that are in our way.
Edward Thomson committed
-
- 02 Jul, 2015 1 commit
-
-
Introduce `git__getenv` which is a UTF-8 aware `getenv` everywhere. Make `cl_getenv` use this to keep consistent memory handling around return values (free everywhere, as opposed to only some platforms).
Edward Thomson committed
-
- 03 Mar, 2015 1 commit
-
-
This changes the get_entry() method to return a refcounted version of the config entry, which you have to free when you're done. This allows us to avoid freeing the memory in which the entry is stored on a refresh, which may happen at any time for a live config. For this reason, get_string() has been forbidden on live configs and a new function get_string_buf() has been added, which stores the string in a git_buf which the user then owns. The functions which parse the string value takea advantage of the borrowing to parse safely and then release the entry.
Carlos Martín Nieto committed
-
- 19 Feb, 2015 1 commit
-
-
Introduce GITTEST_INVASIVE_FS_STRUCTURE for things that are invasive to your filesystem structure (like creating folders at your filesystem root) and GITTEST_INVASIVE_FS_SIZE for things that write lots of data.
Edward Thomson committed
-
- 05 Feb, 2015 1 commit
-
-
Test to ensure that we can create a repository at the filesystem root. Introduces a new test environment variable, `GITTEST_INVASIVE_FILESYSTEM` for tests that do terrible things like escaping the clar sandbox and writing to the root directory. It is expected that the CI builds will enable this but that normal people would not want this.
Edward Thomson committed
-
- 08 Jan, 2015 1 commit
-
-
Remove the hook symlink from the test resources, so that we can have a source tree that is easy to zip up and copy around on systems that don't support symlinks. Create it dynamically at test execution instead.
Edward Thomson committed
-
- 08 Nov, 2014 1 commit
-
-
This brings it in line with the rest of the lookup functions.
Carlos Martín Nieto committed
-
- 17 Sep, 2014 1 commit
-
-
Carlos Martín Nieto committed
-
- 03 Sep, 2014 1 commit
-
-
Teach git_repository_init_ext to use relative paths for the gitlink to the work directory. This is used when creating a sub repository where the sub repository resides in the parent repository's .git directory.
Jameson Miller committed
-
- 14 Nov, 2013 1 commit
-
-
Ben Straub committed
-
- 01 Nov, 2013 1 commit
-
-
Vicent Marti committed
-
- 03 Oct, 2013 3 commits
-
-
This cleans up more of the test suite to check actual filesystem behavior instead of relying on Windows vs. Mac vs. Linux to test.
Russell Belfer committed -
The repo init code was assuming Windows == no filemode, and Mac or Windows == no case sensitivity. Those assumptions are not consistently true depending on the mounted file system. This is a first step to removing those assumptions. It focuses on the repo init code and the tests of that code. There are still many other tests that are broken when those assumptions don't hold true, but this clears up one area of the code. Also, this moves the core.precomposeunicode logic to be closer to the current logic in core Git where it will be set to true on any filesystem where composed unicode is decomposed when read back.
Russell Belfer committed -
This adds initialization of core.precomposeunicode to repo init on Mac. This is necessary because when a Mac accesses a repo on a VFAT or SAMBA file system, it will return directory entries in decomposed unicode even if the filesystem entry is precomposed. This also removes caching of a number of repo properties from the repo init pipeline because these are properties of the specific filesystem on which the repo is created, not of the system as a whole.
Russell Belfer committed
-
- 24 Sep, 2013 1 commit
-
-
Russell Belfer committed
-
- 17 Sep, 2013 1 commit
-
-
There were a lot of places in the test code base that were creating a commit from the index on the current branch. This just adds a helper to handle that case pretty easily. There was only one test where this change ended up tweaking the test data, so pretty easy and mostly just a cleanup.
Russell Belfer committed
-
- 05 Sep, 2013 3 commits
-
-
Russell Belfer committed
-
The GIT_MODE_TYPE macro was looking at all bits above the permissions, but it should really just look at the top bits so that it will give the right results for a setgid or setuid entry. Since we're now using these macros in the tests, this was causing a test failure on platforms that don't support setgid.
Russell Belfer committed -
This fixes an issue checking file modes in the tests that initialize a repo from a template directory when a symlink is used in the template. Also, this updates some other places where we are examining file modes to use the new macros.
Russell Belfer committed
-
- 04 Sep, 2013 3 commits
-
-
Some windows tests were failing
Russell Belfer committed -
Russell Belfer committed
-
It seems that libgit2 is correctly applying the umask when initializing a repository from a template and when creating new directories during checkout, but the test suite is not accounting for possible variations due to the umask. This updates that so that the test suite will work regardless of the umask.
Russell Belfer committed
-
- 16 Aug, 2013 2 commits
-
-
Russell Belfer committed
-
Russell Belfer committed
-