aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* Fix revision solver for branch and tag (#660)Anthony HAMON2017-12-011-19/+26
| | | fix Repository.ResolveRevision for branch and tag
* repository: add tests for pruning and object re-packingJeremy Stribling2017-11-291-0/+61
| | | | | Also, object re-packing should clean up any loose objects that were packed.
* all: fixes for ineffective assignferhat elmas2017-11-261-0/+2
|
* update to go-billy.v4 and go-git-fixtures.v3Máximo Cuadros2017-11-231-4/+4
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* Repository.Clone added Tags option, and set by default AllTags as git doesMáximo Cuadros2017-09-041-0/+21
|
* Add sideband support for pushOri Rawlings2017-09-011-0/+41
|
* repository: Resolve commit when cloning annotated tag, fixes #557Ori Rawlings2017-08-241-0/+21
|
* *: windows support, some more fixes (#533)Manuel Carmona2017-08-031-1/+1
| | | | | | | | | | * fixed windows failed test: "134 FAIL: repository_test.go:340: RepositorySuite.TestPlainOpenBareRelativeGitDirFileTrailingGarbage" * fixed windows failed test: "143 FAIL: worktree_test.go:367: WorktreeSuite.TestCheckoutIndexOS" * fixed windows failed test: "296 FAIL: receive_pack_test.go:36: ReceivePackSuite.TearDownTest" * fixed windows failed test: "152 FAIL: worktree_test.go:278: WorktreeSuite.TestCheckoutSymlink"
* Remote.Clone fix clone of tags in shallow modeMáximo Cuadros2017-08-021-0/+30
|
* Merge pull request #531 from mcuadros/ref-nameMáximo Cuadros2017-08-021-5/+3
|\ | | | | plumbing: moved `Reference.Is*` methods to `ReferenceName.Is*`
| * *: use the new API for ReferenceName.Is* methodsMáximo Cuadros2017-08-021-5/+3
| |
* | config: multiple values in RemoteConfig (URLs and Fetch)Santiago M. Mola2017-08-011-7/+7
|/ | | | | | | | * Change `URL string` to `URL []string` in `RemoteConfig`, since git allows multiple URLs per remote. See: http://marc.info/?l=git&m=116231242118202&w=2 * Fix marshalling of multiple fetch refspecs.
* worktree: expose underlying filesystemMáximo Cuadros2017-07-261-1/+1
|
* *: package context support in Repository, Remote and SubmoduleMáximo Cuadros2017-07-261-31/+86
|
* move Repository.Pull to Worktree.PullMáximo Cuadros2017-07-241-152/+13
|
* remote: push, update remote refs on pushMáximo Cuadros2017-07-221-41/+24
|
* repository: allow push from shallow repositoriesMáximo Cuadros2017-07-191-0/+45
|
* *: upgrade to go-billy.v3, mergeMáximo Cuadros2017-06-181-12/+15
|
* do not convert local paths to URLSantiago M. Mola2017-04-281-4/+4
| | | | | | | * Do not convert local paths to URLs, just keep them as they are. * This way we add support for Windows without taking care of Windows path-to-URL conversion.