summaryrefslogtreecommitdiff
path: root/tests/submodule
Commit message (Collapse)AuthorAgeFilesLines
* status: test submodules with mixed caseEdward Thomson2016-03-312-0/+27
|
* typos in commentsDmitriy Olshevskiy2015-12-211-1/+1
|
* submodule: test updating a submodule w/ a pathEdward Thomson2015-11-043-0/+64
| | | | | Test that `git_submodule_update` can handle a submodule that is freshly cloned and has a path differing from its name.
* Merge pull request #3434 from ethomson/reservednamesCarlos Martín Nieto2015-09-212-0/+17
|\ | | | | Win32 Reserved names: don't reserve names outside the working directory
| * repo::reservedname: test a submodule updateEdward Thomson2015-09-182-0/+17
| | | | | | | | | | | | | | Test an initial submodule update, where we are trying to checkout the submodule for the first time, and placing a file within the submodule working directory with the same name as the submodule (and consequently, the same name as the repository itself).
* | Fix a couple of warningsCarlos Martín Nieto2015-09-181-1/+1
| |
* | git_futils_mkdir_*: make a relative-to-base mkdirEdward Thomson2015-09-171-5/+5
|/ | | | | | | | | | | | 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.
* submodule: add a test for a renamed submdoule dircmn/submodule-refactorCarlos Martín Nieto2015-09-101-0/+55
|
* iterator: use an options struct instead of argsEdward Thomson2015-08-281-2/+4
|
* Merge pull request #3307 from libgit2/cmn/submodule-backslashEdward Thomson2015-07-241-0/+23
|\ | | | | Normalize submodule urls before looking at them
| * submodule: add failing test for backslash in urlCarlos Martín Nieto2015-07-131-0/+23
| |
* | Merge pull request #3303 from libgit2/cmn/index-add-submoduleEdward Thomson2015-07-241-0/+1
|\ \ | | | | | | Allow adding a submodule through git_index_add_bypath
| * | blob: fail to create a blob from a dir with EDIRECTORYCarlos Martín Nieto2015-07-121-0/+1
| |/ | | | | | | | | This also affects `git_index_add_bypath()` by providing a better error message and a specific error code when a directory is passed.
* | submdule: reproduce double-reporting of a submodule in foreachCarlos Martín Nieto2015-07-111-0/+18
|/ | | | | | When we rename a submodule, we should be merging two sets of information based on whether their path is the same. We currently only deduplicate on equal name, which causes us to double-report.
* submodule: add failing test for loading the wrong submoduleCarlos Martín Nieto2015-07-011-0/+23
| | | | | When two submodules are fairly similar, we may end up loading the wrong one.
* submodule: completely remove reload_allCarlos Martín Nieto2015-07-011-2/+0
| | | | | | | | The function was removed, but its declaration and changelog entry about its removal were forgotten. The comment in the test doesn't make any sense as the function doesn't exist anymore, so get rid of it as well.
* submodule: remove trailing slashes from submodule pathsCarlos Martín Nieto2015-06-291-0/+3
| | | | | We allow looking up a submodule by path, but we lost the path normalisation during the recent changes. Bring it back.
* Rename FALLBACK to UNSPECIFIEDcmn/rename-unspecifiedCarlos Martín Nieto2015-06-252-10/+10
| | | | | Fallback describes the mechanism, while unspecified explains what the user is thinking.
* submodule: test unsetting config optionsCarlos Martín Nieto2015-06-221-13/+29
| | | | | | In addition to mapping enums to strings in the configuration, we need to know to delete the configuration option when given the "none" or "no" option.
* submodule: test more accurately for non-existenceCarlos Martín Nieto2015-06-221-4/+4
| | | | | | The current code will always fail, but only because it's asking for a string on a live config. Take a snapshot and make sure we fail with ENOTFOUND instead of any old error.
* submodule: fix potential leak in the testsCarlos Martín Nieto2015-06-221-2/+1
|
* submodule: get rid of `_save()`Carlos Martín Nieto2015-06-221-9/+0
| | | | | We no longer have any setters which affect an instance, so `git_submodule_save()` is no longer relevant.
* submodule: make `_set_url()` affect the configurationCarlos Martín Nieto2015-06-222-42/+9
| | | | With this one, we can get rid of the edit_and_save test.
* submodule: make `_set_branch()` affect the configurationCarlos Martín Nieto2015-06-221-14/+20
|
* submodule: make `_set_update_fetch_recurse_submodules()` affect the configCarlos Martín Nieto2015-06-221-28/+16
| | | | | | Similarly to the other ones. In this test we copy over testing `RECURSE_YES` which shows an error in our handling of the `YES` variant which we may have to port to the rest.
* submodule: make `_set_update()` affect the configurationCarlos Martín Nieto2015-06-221-21/+11
| | | | | Moving on with the removal of runtime-changing variables, the update setting for a remote is whatever it was when it was looked up.
* submodule: add an ignore option to statusCarlos Martín Nieto2015-06-223-48/+37
| | | | | | | | | | | | | This lets us specify in the status call which ignore rules we want to use (optionally falling back to whatever the submodule has in its configuration). This removes one of the reasons for having `_set_ignore()` set the value in-memory. We re-use the `IGNORE_RESET` value for this as it is no longer relevant but has a similar purpose to `IGNORE_FALLBACK`. Similarly, we remove `IGNORE_DEFAULT` which does not have use outside of initializers and move that to fall back to the configuration as well.
* submodule: don't let status change an existing instanceCarlos Martín Nieto2015-06-222-14/+24
| | | | | | As submodules are becomes more like values, we should not let a status check to update its properties. Instead of taking a submodule, have status take a repo and submodule name.
* submodule: make set_ignore() affect the configurationCarlos Martín Nieto2015-06-222-17/+12
| | | | | Instead of affecting a particular instance, make it change the configuration.
* submodule: remove the per-repo cacheCarlos Martín Nieto2015-06-222-46/+0
| | | | | | | | | | | | | Having this cache and giving them out goes against our multithreading guarantees and it makes it impossible to use submodules in a multi-threaded environment, as any thread can ask for a refresh which may reallocate some string in the submodule struct which we've accessed in a different one via a getter. This makes the submodules behave more like remotes, where each object is created upon request and not shared except explicitly by the user. This means that some tests won't pass yet, as they assume they can affect the submodule objects in the cache and that will affect later operations.
* Fix a few leaksCarlos Martín Nieto2015-05-131-0/+1
| | | | | The interesting one is the notification macro, which was returning directly on a soft-abort instead of going through the cleanup.
* Remove the callbacks struct from the remoteCarlos Martín Nieto2015-05-131-2/+2
| | | | | | | | | | | | | | Having the setting be different from calling its actions was not a great idea and made for the sake of the wrong convenience. Instead of that, accept either fetch options, push options or the callbacks when dealing with the remote. The fetch options are currently only the callbacks, but more options will be moved from setters and getters on the remote to the options. This does mean passing the same struct along the different functions but the typical use-case will only call git_remote_fetch() or git_remote_push() and so won't notice much difference.
* Implement git_submodule_set_branch.Patrick Steinhardt2015-04-121-3/+25
|
* Fix git_submodule_sync writing URL to wrong key.Patrick Steinhardt2015-03-121-3/+3
| | | | | | | | Currently git_submodule_sync writes the submodule's URL to the key 'branch.<REMOTE_NAME>.remote' while the reference implementation of `git submodule sync` writes to 'remote.<REMOTE_NAME>.url', which is the intended behavior according to git-submodule(1).
* config: borrow refcounted referencescmn/config-borrow-entryCarlos Martín Nieto2015-03-034-36/+16
| | | | | | | | | | | | | | | 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.
* repository: remove log message override for switching the active branchCarlos Martín Nieto2015-03-032-4/+4
| | | | | | We want to use the "checkout: moving from ..." message in order to let git know when a change of branch has happened. Make the convenience functions for this goal write this message.
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-033-9/+6
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* Fix warningCarlos Martín Nieto2015-01-091-1/+1
|
* submodule::init tests: free some leaksEdward Thomson2015-01-081-1/+5
|
* Introduce a convenience function for submodule updatejamill/submodule_updateJameson Miller2014-12-224-6/+424
| | | | | | | | | This introduces the functionality of submodule update in 'git_submodule_do_update'. The existing 'git_submodule_update' function is renamed to 'git_submodule_update_strategy'. The 'git_submodule_update' function now refers to functionality similar to `git submodule update`, while `git_submodule_update_strategy` is used to get the configured value of submodule.<name>.update.
* submodule init should resolve relative url pathsJameson Miller2014-12-224-0/+89
| | | | | Submodule init should handle relative paths in .gitmodules files and resolve these urls when updating the git config file.
* 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.
* iterator: submodules are determined by an index or treecmn/submodule-and-dirCarlos Martín Nieto2014-11-071-1/+4
| | | | | | | | | | | | We cannot know from looking at .gitmodules whether a directory is a submodule or not. We need the index or tree we are comparing against to tell us. Otherwise we have to assume the entry in .gitmodules is stale or otherwise invalid. Thus we pass the index of the repository into the workdir iterator, even if we do not want to compare against it. This follows what git does, which even for `git diff <tree>`, it will consider staged submodules as such.
* submodule test: free submoduleEdward Thomson2014-10-261-0/+1
|
* remote: accept a repo and name for renamingcmn/remote-renameCarlos Martín Nieto2014-10-241-3/+1
| | | | | | | | | | Remote objects are not meant to be changed from under the user. We did this in rename, but only the name and left the refspecs, such that a save would save the wrong refspecs (and a fetch and anything else would use the wrong refspecs). Instead, let's simply take a name and not change any loaded remote from under the user.
* Introduce option to use relative paths for repository work directoryjamill/relative_gitlinkJameson Miller2014-09-022-0/+60
| | | | | | | 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.
* Merge pull request #2407 from libgit2/cmn/remote-rename-morev0.21.0-rc1Vicent Marti2014-06-081-1/+4
|\ | | | | More remote rename fixes
| * remote: return problem refspecs instead of using a callbackCarlos Martín Nieto2014-06-061-1/+4
| | | | | | | | | | | | There is no reason why we need to use a callback here. A string array fits better with the usage, as this is not an event and we don't need anything from the user.
* | Win32: Fix diff::workdir::submodules test #2361Philip Kelley2014-06-071-2/+2
|/
* Test (and fix) the git_submodule_sync changesRussell Belfer2014-04-031-8/+26
| | | | | I wrote this stuff a while ago and forgot to write tests. Wanted to do so now to wrap up the PR and immediately found problems.