aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/commit_test.go
Commit message (Collapse)AuthorAgeFilesLines
* Expose Storage cache.kuba--2018-09-071-2/+2
| | | | Signed-off-by: kuba-- <kuba@sourced.tech>
* object: fix panic when reading object headerJavi Fontan2018-08-171-0/+34
| | | | | | | | When the first line of the pgp signature is an empty line or some header is malformed it crashes as there's no data for the header element. For example, if author name is "\n". Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing/object: fix pgp signature encoder/decoderJavi Fontan2018-07-181-0/+32
| | | | | | | | | | | | | | | | | | The way of reading pgp signatures was searching for pgp begin line in the header. This caused problems when this string appeared and was not part of the signature. For example if it appears in the message as an example or is part of the author name the decoder starts treating it as a signature. In this state the code was not able to notice then the header ended so it entered in an infinite loop searching for pgp end string. Now it uses the same method as original git. Searches for gpgsig section in header and starts getting all lines until the next part. In encoder the string used to add signatures was incorrect. It is now changed to the proper "gpgsig" string instead of "pgpsig". Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing: add context to allow cancel on diff/patch computingMarc Barussaud2018-07-021-0/+66
| | | | Signed-off-by: Marc Barussaud <marc.barussaud@orange.com>
* all: fixes for ineffective assignferhat elmas2017-11-261-0/+1
|
* test: plumbing/object fix Commit.Verify testSunny2017-11-241-2/+3
| | | | | Test was failing because of the relative time zone attached to the commit. Adding a fixed location to the time fixes the issue.
* Merge pull request #653 from darkowlzz/verify-commitMáximo Cuadros2017-11-241-0/+65
|\ | | | | plumbing: object, new Commit.Verify method
| * test: plumbing.object, add test for Commit.VerifySunny2017-11-231-0/+65
| |
* | update to go-billy.v4 and go-git-fixtures.v3Máximo Cuadros2017-11-231-1/+1
|/ | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* Merge pull request #534 from josharian/firstparentMáximo Cuadros2017-11-201-0/+12
|\ | | | | plumbing: object, commit.Parent() method
| * plumbing: object, commit.Parent() methodMáximo Cuadros2017-11-201-0/+12
| | | | | | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* | Add Stats() to Patch and fix diffstat outputSunny2017-11-021-1/+3
| |
* | Add Stats() to CommitSunny2017-11-021-0/+24
| | | | | | | | Stats() is similar to `git show --stat <hash>`.
* | Add support for signed commits (#616)Sunny2017-10-291-0/+26
|/ | | | | | | | | * Add support for signed commits This change adds `GPGSignature` field to `Commit` object. This is used to store the signature of the commit, if any. * Rename gpg to pgp
* format/diff: unified diff encoder and public APIAntonio Jesus Navarro Perez2017-05-231-0/+54
| | | | | | | | | - Added Patch interface - Added a Unified Diff encoder from Patches - Added Change method to generate Patches - Added Changes method to generate Patches - Added Tree method to generate Patches - Added Commit method to generate Patches
* plumbing: object.Tree making public `tree` and `parents`Máximo Cuadros2017-05-011-7/+7
|
* Add Repository.Log() method (fix #298)Antonio Jesus Navarro Perez2017-04-111-8/+2
| | | | | | | | | | - CommitIter is now an interface - The old CommitIter implementation is now called StorerCommitIter - CommitWalker and CommitWalkerPost are now iterators (CommitPreIterator and CommitPostIterator). - Remove Commit.History() method. There are so many ways to iterate a commit history, depending of the use case. Now, instead of use the History() method, you must use CommitPreIterator or CommitPostIterator. - Move commitSorterer to references.go because is the only place that it is used, and it must not be used into another place. - Make References method private, it must only be used into blame logic. - Added a TODO into references method, where the sortCommits is used to remove it in a near future.
* plumbing: Use ReadBytes() rather than ReadSlice()Nick Thomas2017-03-271-0/+17
|
* project: move imports from srcd.works to gopkg.inAntonio Jesus Navarro Perez2017-03-071-2/+2
| | | | To be able to fix #261 we will move again to gopkg.in before v4 stable release.
* new srcd.works/go-git.v4 pathMáximo Cuadros2017-01-301-2/+2
|
* new git fixture pathMáximo Cuadros2017-01-301-1/+1
|
* move plumbing from top level package to plumbing (#183)Santiago M. Mola2016-12-141-0/+169
* plumbing: rename Object -> EncodedObject. * plumbing/storer: rename ObjectStorer -> EncodedObjectStorer. * move difftree to plumbing/difftree. * move diff -> utils/diff * make Object/Tag/Blob/Tree/Commit/File depend on storer. * Object and its implementations now depend only on storer.EncodedObjectStorer, not git.Repository. * Tests are decoupled accordingly. * move Object/Commit/File/Tag/Tree to plumbing/object. * move Object/Commit/File/Tag/Tree to plumbing/object. * move checkClose to utils/ioutil. * move RevListObjects to plumbing/revlist.Objects. * move DiffTree to plumbing/difftree package. * rename files with plural nouns to singular * plumbing/object: add GetBlob/GetCommit/GetTag/GetTree.