summaryrefslogtreecommitdiff
path: root/tests/repo/init.c
Commit message (Collapse)AuthorAgeFilesLines
* git_repository_init: stop traversing at windows rootethomson/windows_init_traversalEdward Thomson2019-04-171-0/+12
| | | | | | | | | | | | | | | | 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:\`.
* references: use new names in internal usageethomson/git_refEdward Thomson2019-01-171-1/+1
| | | | Update internal usage to use the `git_reference` names for constants.
* symlink tests: test symbolic links on windowsethomson/win_symlinksEdward Thomson2018-10-201-30/+60
| | | | | | | | | 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.
* repo::init tests: refactor global config path overrideEdward Thomson2018-10-201-9/+14
| | | | | Provide a function that allows tests to set up a bespoke global configuration path.
* tests: provide symlink support helper functionEdward Thomson2018-10-201-8/+1
|
* repo tests: ensure core.symlinks is set correctlyEdward Thomson2018-10-201-0/+13
| | | | | | 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.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-101-24/+24
|
* s/Init/Index comment tweak for test_repo_init__init_with_initial_commitChristine Poerschke2017-11-121-1/+1
|
* tests: try to init with empty template pathAriel Davis2017-06-161-0/+11
|
* git_repository_init: include dotfiles when copying templatesEdward Thomson2015-12-261-1/+12
| | | | | | 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.
* repo::init tests: test a template dir with leading dotEdward Thomson2015-12-261-9/+37
| | | | | Ensure that we can handle template directories that begin with a leading dot.
* repo::init tests: test init.templatedir settingEdward Thomson2015-12-261-38/+93
| | | | | Ensure that `git_repository_init` honors the `init.templatedir` configuration setting.
* git_futils_mkdir_*: make a relative-to-base mkdirEdward Thomson2015-09-171-3/+3
| | | | | | | | | | | | 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.
* git__getenv: utf-8 aware env readerEdward Thomson2015-07-021-1/+1
| | | | | | 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).
* config: borrow refcounted referencescmn/config-borrow-entryCarlos Martín Nieto2015-03-031-12/+3
| | | | | | | | | | | | | | | 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.
* tests: separate INVASIVE filesystem testsEdward Thomson2015-02-191-1/+1
| | | | | | 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.
* repo: ensure we can create repo at filesystem rootEdward Thomson2015-02-051-0/+26
| | | | | | | | | 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.
* repo::init test: create hook symlinkEdward Thomson2015-01-081-9/+40
| | | | | | | 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.
* remote: rename _load() to _lookup()cmn/remote-lookupCarlos Martín Nieto2014-11-081-1/+1
| | | | This brings it in line with the rest of the lookup functions.
* Clean up some leaks in the test suiteCarlos Martín Nieto2014-09-171-0/+1
|
* Introduce option to use relative paths for repository work directoryjamill/relative_gitlinkJameson Miller2014-09-021-0/+78
| | | | | | | 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.
* Rename tests-clar to testsBen Straub2013-11-141-0/+606