aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
Commit message (Collapse)AuthorAgeFilesLines
* git: Implement Merge function with initial FastForwardMerge supportPaulo Gomes2024-03-091-36/+90
| | | | | | | | | | | | Introduces the Merge function for merging branches in the codebase. Currently, the function only supports FastForwardMerge strategy, meaning it can efficiently update the target branch pointer if the source branch history is a linear descendant. Support for additional merge strategies (e.g., three-way merge) will be added in future commits. Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
* git: Add Merge with ff-onlyJohn Cai2024-03-091-0/+53
| | | | | | Add a Merge function that behaves like git merge. This is a first iteration that only supports --ff-only, which is the simplest type of merge.
* git: validate reference namesAyman Bagabas2023-11-301-0/+37
| | | | | | | | | | Check reference names format before creating branches/tags/remotes. This should probably be in a lower level somewhere in `plumbing`. Validating the names under `plumbing.NewReference*` is not possible since these functions don't return errors. Fixes: https://github.com/go-git/go-git/issues/929
* *: Improve BenchmarkPlainClonePaulo Gomes2023-10-281-11/+16
| | | | | | | The changes aim to make that specific benchmark more reliable for setting a baseline which can later be use to compare against future changes on the most basic feature of go-git: plain cloning repositories.
* git: clone --shared implementedenverbisevac2023-10-081-0/+96
|
* git: allow using `InitOptions` with `PlainInitWithOptions`ThinkChaos2023-09-151-2/+11
|
* git: add `PlainInitOptions.Bare`ThinkChaos2023-09-151-0/+15
| | | | Refactor `PlainInit` to call `PlainInitWithOptions`
* *: Handle paths starting with ~usernameArieh Schneier2023-07-091-4/+13
| | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* *: Add test for paths starting with tildericci25112023-07-071-0/+15
|
* Merge pull request #765 from matejrisek/feature/shallow-submodules-optionPaulo Gomes2023-06-071-0/+37
|\ | | | | git: add a clone option to allow for shallow cloning of submodules
| * git: add a clone option to allow for shallow cloning of submodulesmatej.risek2023-06-051-0/+37
| | | | | | | | | | This option matches the git clone option --shallow-submodules. https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---no-shallow-submodules
* | git: Clone HEAD should not force master. Fixes #363Arieh Schneier2023-06-041-6/+43
| | | | | | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* | Merge pull request #764 from techknowlogick/init-optionsPaulo Gomes2023-05-231-0/+48
|\ \ | | | | | | git: Allow Initial Branch to be configurable
| * | git: Allow Initial Branch to be configurabletechknowlogick2023-05-211-0/+48
| |/
* / git: Testing, Fix tests not cleaning temp foldersArieh Schneier2023-05-111-9/+9
|/ | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* git: fix cloning with branch nameArieh Schneier2023-05-031-1/+9
| | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* feat(clone): add mirror clone optionAyman Bagabas2023-04-171-0/+29
| | | | | | | | | | | | Clone remote as a mirror. This fetches all remote refs, implies bare repository, and sets the appropriate configs. Fixes: https://github.com/go-git/go-git/issues/293 Update options.go Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com> Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
* *: Fix panic for empty revisionsPaulo Gomes2023-03-021-0/+9
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* Repository: don't crash accessing invalid pathinfo (#443)Christian Muehlhaeuser2022-01-191-0/+5
| | | | | | | | | | | | | When fs.Stat returns an error, pathinfo may be nil. In such situations the only safe response seems to be to return the error to the caller. Without this fix, accessing pathinfo.IsDir() below would lead to a crash dereferencing a nil pointer. This crash can be reproduced by trying to initialize a Git repo with an invalid path name. Also see: https://github.com/muesli/gitty/issues/36
* Merge pull request #425 from abhinav/error-stringsMáximo Cuadros2021-12-111-1/+1
|\ | | | | error strings: Don't capitalize, use periods, or newlines
| * Fix repository_testAbhinav Gupta2021-12-101-1/+1
| | | | | | | | The test verifies the exact error message.
* | simplified sparse checkoutJohn Cai2021-11-091-0/+31
|/ | | | | | | | | This is the initial logic to support a simple sparse checkout where directories to be included can be specified in CheckoutOptions. This change doesn't fully support the sparse patterns, nor does this change include the optimization to collapse flie entries in ithe index that are excluded via the sparse checkout directory patterns included under the parent directory.
* *: use go-billy instead of os callsMáximo Cuadros2021-05-021-106/+157
|
* Repository: test, use raw string to avoid double-escape (#288)Jeff Widman2021-04-161-1/+1
|
* *: replace golang.org/x/crypto/openpgp by ↵Johan Fleury2021-04-061-3/+3
| | | | github.com/ProtonMail/go-crypto/openpgp (#283)
* plumbing: wire up contexts for Transport.AdvertisedReferences (#246)Andrew Suffield2021-03-261-6/+6
| | | | | * plumbing: wire up contexts for Transport.AdvertisedReferences * add more tests for context wiring
* support file path in PlainOpenWithOptions - do only when detect flag is enabledAshok Pon Kumar2020-09-021-1/+5
|
* support file path in PlainOpenWithOptionsAshok Pon Kumar2020-09-021-0/+10
|
* Merge pull request #125 from cristaloleg/minor-linter-fixesMáximo Cuadros2020-07-161-1/+1
|\ | | | | *: minor linter fixes
| * Minor linter fixesOleg Kovalov2020-07-061-1/+1
| |
* | Support partial hashes in Repository.ResolveRevision.David Symonds2020-07-161-0/+1
|/ | | | | | | | | | | | | Like `git rev-parse <prefix>`, this enumerates the hashes of objects with the given prefix and adds them to the list of candidates for resolution. This has an exhaustive slow path, which requires enumerating all objects and filtering each one, but also a couple of fast paths for common cases. There's room for future work to make this faster; TODOs have been left for that. Fixes #135.
* fix goreportcard warningsOleg Kovalov2020-07-011-0/+1
|
* CreateTagOptions.Validate: load Tagger from configMáximo Cuadros2020-06-051-9/+1
|
* Repository.ConfigScoped and Repository.Commit with empty author supportMáximo Cuadros2020-05-241-0/+15
|
* ci: based on github actionsv5.0.0Máximo Cuadros2020-03-151-5/+1
|
* *: migration from go-git-fixtures/v4 and go-git/gcfgMáximo Cuadros2020-03-101-6/+2
|
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-101-16/+16
|
* add back test for NewCommitFileIterFromIterSaeed Rasooli2019-11-291-0/+11
| | | | Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
* repository_test.go: add TestLogPathFilterRegexpSaeed Rasooli2019-11-291-0/+36
| | | | Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
* add `PathFilter func(string) bool` to LogOptionsSaeed Rasooli2019-11-291-0/+15
| | | | Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
* add NewCommitPathIterFromIter that accepts pathFilter func(string) boolSaeed Rasooli2019-11-291-4/+7
| | | | | | keep NewCommitFileIterFromIter for compatibilty for now Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
* Add limiting options to git logknqyf2632019-08-041-1/+131
| | | | Signed-off-by: knqyf263 <knqyf263@gmail.com>
* Add TestLogFileWithError for coverageknqyf2632019-08-031-1/+23
| | | | Signed-off-by: knqyf263 <knqyf263@gmail.com>
* Handle io.EOF error in commitFileIter.ForEachknqyf2632019-08-031-1/+1
| | | | Signed-off-by: knqyf263 <knqyf263@gmail.com>
* Add assertion for unhandled error in TestLogFileknqyf2632019-08-031-4/+8
| | | | Signed-off-by: knqyf263 <knqyf263@gmail.com>
* *: added missing error checks in testsChristian Muehlhaeuser2019-07-291-1/+3
| | | | | | | | | | When we assign a value to err, make sure to also check for it being nil afterwards. If those were intentionally unchecked, we should remove the assignment in the first place. Those checks certainly never harm, but please review thoroughly and let me know. Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com> (cherry picked from commit 19d6f42a4d814a50bd262fbb69a9b670db9756a2)
* Worktree: improve build index performance. (#1179)Nao YONASHIRO2019-07-251-0/+20
|
* improve ResolveRevision's Ref lookup pathMike Lundy2019-05-141-5/+5
| | | | | | | | | | 1) lookups on an annotated tag oid now work 2) there was a lot of complexity around detection of ambiguity, but unlike git, ambiguous refs are rejected (which causes bugs like #823). The new code matches rev-parse's behavior (prefer the OID), though there is no warning path to report the same warning. Signed-off-by: Mike Lundy <mike@fluffypenguin.org>
* add Repository.CreateRemoteAnonymousniukuo2019-03-221-0/+30
| | | | Signed-off-by: niukuo <niukuo@gmail.com>
* Ignore missing references on log --allAntonio Jesus Navarro Perez2019-02-121-0/+62
| | | | | | To mimic the actual standard git behavior, we must ignore references that are pointing to wrong/unexistent objects. Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>