summaryrefslogtreecommitdiff
path: root/tests/rebase
Commit message (Collapse)AuthorAgeFilesLines
* tests: declare functions statically where appropriateEdward Thomson2021-11-113-3/+3
|
* str: introduce `git_str` for internal, `git_buf` is externalethomson/gitstrEdward Thomson2021-10-172-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | libgit2 has two distinct requirements that were previously solved by `git_buf`. We require: 1. A general purpose string class that provides a number of utility APIs for manipulating data (eg, concatenating, truncating, etc). 2. A structure that we can use to return strings to callers that they can take ownership of. By using a single class (`git_buf`) for both of these purposes, we have confused the API to the point that refactorings are difficult and reasoning about correctness is also difficult. Move the utility class `git_buf` to be called `git_str`: this represents its general purpose, as an internal string buffer class. The name also is an homage to Junio Hamano ("gitstr"). The public API remains `git_buf`, and has a much smaller footprint. It is generally only used as an "out" param with strict requirements that follow the documentation. (Exceptions exist for some legacy APIs to avoid breaking callers unnecessarily.) Utility functions exist to convert a user-specified `git_buf` to a `git_str` so that we can call internal functions, then converting it back again.
* rebase: fix (deprecated) signing testethomson/deprecationEdward Thomson2021-09-211-7/+7
|
* rebase: deprecate signing_cbethomson/commit_create_cbEdward Thomson2021-08-291-11/+26
| | | | | The signing callback should not be used; instead, callers should provide a commit_create_cb, perform the signing and commit creation themselves.
* rebase: introduce git_commit_create_cbEdward Thomson2021-08-291-0/+231
| | | | | | | Introduce a new mechanism for `git_rebase_commit` for callers to customize the experience. Instead of assuming that we produce the commit for them, provide a commit creation callback that allows callers to produce the commit themselves and return the resulting commit id.
* Merge pull request #4913 from implausible/feature/signing-rebase-commitsPatrick Steinhardt2019-08-091-0/+243
|\ | | | | Add sign capability to git_rebase_commit
| * fixup: code cleanup around rebase commit signingTyler Ang-Wanek2019-07-021-9/+3
| | | | | | | | | | Use ci_git_fail_with where appropriate. Use correct initializer for callback.
| * fixup: More generic signing_cb for future flexibilityTyler Wanek2019-01-241-8/+8
| | | | | | | | | | In the case that we want to build merge + commit, cherrypick + commit, or even just build a commit with signing callback, `git_rebase_commit_signature_cb` particular callback should be made more generic. We also renamed `signature_cb` to `signing_cb` to improve clarity on the purpose of the callback (build a difference between a git_signature and the act of signing). So we've ended up with `git_commit_signing_cb`.
| * Update formatting of newly added rebase sign test suiteTyler Wanek2019-01-231-124/+124
| |
| * Single callback for commit signing in rebase w/ git_bufTyler Wanek2019-01-231-33/+30
| | | | | | Reduces the number of callbacks for signing a commit during a rebase operation to just one callback. That callback has 2 out git_buf parameters for signature and signature field. We use git_buf here, because we cannot make any assumptions about the heap allocator a user of the library might be using.
| * Add tests for signing rebase commitsTyler Wanek2019-01-231-0/+252
| |
* | rebase: orig_head and onto accessorsErik Aigner2019-04-211-0/+10
|/ | | | | | | | The rebase struct stores fields with information about the current rebase process, which were not accessible via a public interface. Accessors for getting the `orig_head` and `onto` branch names and object ids have been added.
* references: use new names in internal usageethomson/git_refEdward Thomson2019-01-171-3/+3
| | | | Update internal usage to use the `git_reference` names for constants.
* object_type: use new enumeration namesethomson/index_fixesEdward Thomson2018-12-013-16/+16
| | | | Use the new object_type enumeration names within the codebase.
* treewide: remove use of C++ style commentsPatrick Steinhardt2018-07-136-6/+6
| | | | | | | | | C++ style comment ("//") are not specified by the ISO C90 standard and thus do not conform to it. While libgit2 aims to conform to C90, we did not enforce it until now, which is why quite a lot of these non-conforming comments have snuck into our codebase. Do a tree-wide conversion of all C++ style comments to the supported C style comments to allow us enforcing strict C90 compliance in a later commit.
* index: commit the changes to the index properlyEdward Thomson2018-06-291-1/+2
| | | | | | | Now that the index has a "dirty" state, where it has changes that have not yet been committed or rolled back, our tests need to be adapted to actually commit or rollback the changes instead of assuming that the index can be operated on in its indeterminate state.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-101-1/+1
|
* tests: rebase::submodule: verify initialization method callsPatrick Steinhardt2017-07-281-7/+7
| | | | | | | | | Some return codes for functions which may fail are not being checked in `test_rebase_submodule__initialize`. This may lead us to not notice errors when initializing the environment and would possibly result in either memory corruption or segfaults as soon as any of the initialization steps fails. Fix this by wrapping these function calls into `cl_git_pass`.
* tests: fix the rebase-submodule testEtienne Samson2017-07-251-7/+36
|
* rebase: ignore untracked files in submodulesDavid Turner2017-03-031-0/+65
| | | | | | | | | An untracked file in a submodule should not prevent a rebase from starting. Even if the submodule's SHA is changed, and that file would conflict with a new tracked file, it's still OK to start the rebase and discover the conflict later. Signed-off-by: David Turner <dturner@twosigma.com>
* rebase: plug a leak in the testscmn/plug-test-leakCarlos Martín Nieto2016-12-171-0/+1
|
* git_rebase_init: correctly handle detached HEADDavid Turner2016-12-011-0/+53
| | | | | | | | git_rebase_finish relies on head_detached being set, but rebase_init_merge was only setting it when branch->ref_name was unset. But branch->ref_name would be set to "HEAD" in the case of detached HEAD being either implicitly (NULL) or explicitly passed to git_rebase_init.
* rebase: test rebasing a new commit with subfolderEdward Thomson2016-06-022-0/+82
| | | | | Test a rebase (both a merge rebase and an inmemory rebase) with a new commit that adds files underneath a new subfolder.
* rebase: test rebase (merge) w/ no common ancestorEdward Thomson2016-05-032-5/+104
|
* rebase::abort: test we can abort rebase by revspecEdward Thomson2016-04-261-0/+19
| | | | | Test that we can properly abort a rebase when it is initialized by a revspec. This ensures that we do not conflate revspecs and refnames.
* rebase: correctly finish rebasing detached headsethomson/rebase_detachedEdward Thomson2016-04-211-0/+50
| | | | | When rebasing with IDs, we do not return to the `branch`, we remain in a detached HEAD state.
* rebase: test abort immediately after initEdward Thomson2016-04-211-5/+65
| | | | | Instead of `open`ing a rebase and `abort`ing that, test that we can `abort` a rebase that has just begun with `init`.
* Merge pull request #3623 from ethomson/rebase_with_commitCarlos Martín Nieto2016-03-093-5/+288
|\ | | | | rebase: additional setup tests of exotic behavior
| * rebase: additional tests for completing a rebaseEdward Thomson2016-02-282-5/+83
| |
| * rebase: additional setup tests of exotic behaviorEdward Thomson2016-02-171-0/+205
| | | | | | | | | | | | | | Test some additional exotic rebase setup behavior: that we are able to set up properly when already in a detached HEAD state, that the caller specifies all of branch, upstream and onto, and that the caller specifies branch, upstream and onto by ID.
* | rebase: persist a single in-memory indexEdward Thomson2016-02-152-6/+24
|/ | | | | | When performing an in-memory rebase, keep a single index for the duration, so that callers have the expected index lifecycle and do not hold on to an index that is free'd out from under them.
* rebase: allow custom merge_optionsEdward Thomson2016-02-111-0/+30
| | | | | | Allow callers of rebase to specify custom merge options. This may allow custom conflict resolution, or failing fast when conflicts are detected.
* rebase: introduce inmemory rebasingEdward Thomson2016-02-112-6/+138
| | | | | | | | | | Introduce the ability to rebase in-memory or in a bare repository. When `rebase_options.inmemory` is specified, the resultant `git_rebase` session will not be persisted to disk. Callers may still analyze the rebase operations, resolve any conflicts against the in-memory index and create the commits. Neither `HEAD` nor the working directory will be updated during this process.
* Fixed unused warning in tests/rebase/merge.cTomas Paladin Volf2015-04-301-0/+5
|
* rebase: include checkout opts within rebase optsEdward Thomson2015-04-201-1/+2
|
* rebase: test checkout options for rebaseEdward Thomson2015-04-201-0/+49
|
* rebase: init and open take a rebase_optionsEdward Thomson2015-04-204-76/+49
| | | | | | `git_rebase_init` and `git_rebase_open` should take a `git_rebase_options` and use it for future rebase operations on that `rebase` object.
* rebase: take `checkout_options` where appropriateEdward Thomson2015-04-204-22/+22
|
* rebase: block rebase_commit with unstaged changesEdward Thomson2015-04-201-0/+35
|
* rebase: commit should return GIT_EUNMERGEDEdward Thomson2015-04-201-1/+3
| | | | | git_rebase_commit should return `GIT_EUNMERGED` when unmerged items exist in the index, per the documentation. Test that this is correct.
* rebase: identify a rebase that has not startedEdward Thomson2015-04-201-1/+1
| | | | | | In `git_rebase_operation_current()`, indicate when a rebase has not started (with `GIT_REBASE_NO_OPERATION`) rather than conflating that with the first operation being in-progress.
* repository: remove log message override for switching the active branchCarlos Martín Nieto2015-03-031-1/+1
| | | | | | 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-034-31/+23
| | | | | | | | | | 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.
* rebase: allow `NULL` branch to indicate `HEAD`Edward Thomson2015-02-131-0/+49
| | | | | Don't require the branch to rebase, if given `NULL`, simply look up `HEAD`.
* rebase: provide NULL `exec` on non-EXEC operationsEdward Thomson2015-02-131-0/+1
| | | | | Users may want to try to pay attention to the `exec` field on all rebase operations.
* Fix broken merge tests due to autocrlf was not falseLinquize2014-12-071-0/+12
|
* notes: move the notes name argumentCarlos Martín Nieto2014-12-061-2/+2
| | | | | Make it consistent between git_note_create() and git_note_remote() by putting it after the repository.
* s/git_merge_head/git_annotated_commitEdward Thomson2014-10-264-103/+104
| | | | | Rename git_merge_head to git_annotated_commit, as it becomes used in more operations than just merge.
* rebase: clean up some warnings and memory leaksEdward Thomson2014-10-261-0/+1
|
* git_rebase: iterators for operationsEdward Thomson2014-10-261-0/+108
|