aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Implement git log --allkuba--2019-01-071-6/+122
| | | | Signed-off-by: kuba-- <kuba@sourced.tech>
* repository: fix plain clone error handling regressionSantiago M. Mola2018-11-271-8/+43
| | | | | | | | | | | PR #1008 introduced a regression by changing the errors returned by PlainClone when a repository did not exist. This change goes back to returned errors as they were in v4.7.0. Fixes #1027 Signed-off-by: Santiago M. Mola <santi@mola.io>
* repository: Fix RefSpec for a single tag. Fixes #960Fedor Korotkov2018-11-071-0/+26
| | | | Signed-off-by: Fedor Korotkov <fedor.korotkov@gmail.com>
* improve cleanup implementation, add more testsSantiago M. Mola2018-10-301-6/+48
| | | | Signed-off-by: Santiago M. Mola <santi@mola.io>
* repository: added cleanup for the PlainCloneContext()Bartek Jaroszewski2018-10-301-5/+43
| | | | Signed-off-by: Bartek Jaroszewski <jaroszewskibartek@gmail.com>
* Merge pull request #984 from mcuadros/open-bareMáximo Cuadros2018-10-161-5/+5
|\ | | | | repository: allow open non-bare repositories as bare
| * repository: allow open non-bare repositories as bareMáximo Cuadros2018-10-151-5/+5
| | | | | | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* | teach ResolveRevision how to look up annotated tags, testMáximo Cuadros2018-10-151-2/+1
| | | | | | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* | Merge branch 'master' of github.com:src-d/go-git into annotatedMáximo Cuadros2018-10-151-13/+629
|\ \
| * \ Merge pull request #828 from fooker/patch-1Máximo Cuadros2018-10-151-0/+13
| |\ \ | | | | | | | | Use remote name in fetch while clone
| | * | use remote name in fetch while clone, testMáximo Cuadros2018-10-151-0/+13
| | | | | | | | | | | | | | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
| * | | Plumbing: object, Add support for Log with filenames. Fixes #826 (#979)Nithin Gangadharan2018-10-111-0/+139
| | |/ | |/| | | | plumbing: object, Add support for Log with filenames. Fixes #826
| * | repository: fix test for new Storage constructorMáximo Cuadros2018-09-101-7/+5
| | | | | | | | | | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
| * | Merge branch 'master' of github.com:src-d/go-git into f-add-tagging-supportMáximo Cuadros2018-09-101-16/+8
| |\ \
| | * | Expose Storage cache.kuba--2018-09-071-19/+11
| | | | | | | | | | | | | | | | Signed-off-by: kuba-- <kuba@sourced.tech>
| * | | git: s/TagObjectOptions/CreateTagOptions/Chris Marchesi2018-09-071-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Just renaming the TagObjectOptions type to CreateTagOptions so that it's consistent with the other option types. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
| * | | git: Add some tests for annotated tag deletionChris Marchesi2018-09-071-3/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a couple of tests for annotated tag deletion: * The first one is a general test and should work regardless of the fixture used - the tag object could possibly be packed, so we do a prune *and* a repack operation before testing to see if the object was GCed correctly. * The second one actually creates the tag to be deleted, so that the tag object gets created as a loose, unpacked object. This is so we can effectively test that purning unpacked objects is now working 100% correctly (this was failing before because tag objects were not supported for walking). Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
| * | | git: Don't return tag object with Tag, adjust docs for Tag and TagsChris Marchesi2018-08-231-35/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've mainly noticed that in using the current Tag function, that there were lots of times that I was ignoring the ref or the object, depending on what I needed. This was evident in the tests as well. As such, I think it just makes more sense for a singular tag fetcher to return just a ref, through which the caller may grab the annotation if they need it, and if it exists. Also, contrary to the docs on Tags, all tags have a ref, even if they are annotated. The difference between a lightweight tag and an annotated tag is the presence of the tag object, which the ref will point to if the tag is annotated. As such I've adjusted the docs with an example as to how one can get the annotation for a tag ref through the iterator. Source: https://git-scm.com/book/en/v2/Git-Internals-Git-References, tags section. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
| * | | git: Discern tag target type from supplied hashChris Marchesi2018-08-231-28/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I figured there was a way to do this without having to have TagObjectOptions supply this in - there is. Added support for this in and removed the object type from TagObjectOptions. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
| * | | git: Canonicalize incoming annotated tag messagesChris Marchesi2018-08-211-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tag messages are highly sensitive to being in the expected format, especially when encoding/decoding for PGP verification. As such, we do a simple trimming of whitespace on the incoming message and add a newline on the end, to ensure there are no surprises here. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
| * | | git: Add tagging supportChris Marchesi2018-08-211-0/+265
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a few methods: * CreateTag, which can be used to create both lightweight and annotated tags with a supplied TagObjectOptions struct. PGP signing is possible as well. * Tag, to fetch a single tag ref. As opposed to Tags or TagObjects, this will also fetch the tag object if it exists and return it along with the output. Lightweight tags just return the object as nil. * DeleteTag, to delete a tag. This simply deletes the ref. The object is left orphaned to be GCed later. I'm not 100% sure if DeleteTag is the correct behavior - looking for details on exactly *what* happens to a tag object if you delete the ref and not the tag were sparse, and groking the Git source did not really produce much insight to the untrained eye. This may be something that comes up in review. If deletion of the object is necessary, the in-memory storer may require some updates to allow DeleteLooseObject to be supported. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
| * | Merge pull request #906 from src-d/perf/packfile-readsMáximo Cuadros2018-08-141-0/+56
| |\ \ | | | | | | | | Improve packfile reading performance
| | * | git: add benchmark for iterating repository objectsMiguel Molina2018-08-101-0/+56
| | |/ | | | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
| * / Fixed cloning of a single tagFedor Korotkov2018-08-081-1/+27
| |/ | | | | | | | | | | Relates to #870 Signed-off-by: Fedor Korotkov <fedor.korotkov@gmail.com>
* | teach ResolveRevision how to look up annotated tags, testMáximo Cuadros2018-10-151-0/+19
| | | | | | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* | Teach ResolveRevision how to look up annotated tagsMike Lundy2018-05-111-1/+1
|/ | | | Signed-off-by: Mike Lundy <mike@fluffypenguin.org>
* Merge pull request #706 from antham/resolve-commit-sha1v4.3.1Máximo Cuadros2018-04-171-3/+13
|\ | | | | Resolve full commit sha
| * Resolve full commit sha to plumbing hashantham2018-04-161-3/+13
| | | | | | | | Signed-off-by: antham <hamonanth@gmail.com>
* | git: remote, Add shallow commits instead of substituting. Fixes #412Javi Fontan2018-04-161-0/+63
|/ | | | | | | | | | updateShallow substituted the previous shallow list with the one returned by the UploadPackResponse. If the repository had previous shallow commits these are deleted from the list. This change adds the new shallow hashes to the old ones. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* config: adds branches to config for tracking branches against remotes, ↵Jeremy Chambers2018-04-101-0/+146
| | | | | | updates clone to track when cloning a branch. Fixes #313 Signed-off-by: Jeremy Chambers <jeremy@thehipbot.com>
* add PlainOpen variant to find .git in parent dirsDaniel Martí2018-04-031-0/+30
| | | | | | | | | This is the git tool's behavior that people are used to; if one runs a git command in a repository's subdirectory, git still works. Fixes #765. Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
* *: skip time consuming testsMáximo Cuadros2018-03-211-0/+13
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* Fix "too few values in struct initializer" in repository_test.goSaeed Rasooli2018-03-051-2/+2
| | | | Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
* Support for clone without checkoutMichael Rykov2018-01-171-0/+22
|