aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #286 from ajnavarro/fix/reference-iteratorMáximo Cuadros2017-02-242-1/+25
|\ | | | | plumbing/storer: referenceIterator now returns the error if any
| * plumbing/storer: referenceIterator now returns the error if anyAntonio Jesus Navarro Perez2017-02-232-1/+25
| |
* | difftree: ignore permissions changes between regular filesAlberto Cortés2017-02-222-6/+45
| | | | | | | | Fix issue #279.
* | test for issue 279Alberto Cortés2017-02-222-4/+28
|/
* Merge pull request #282 from mcuadros/ssh-agent-fixMáximo Cuadros2017-02-212-3/+26
|\ | | | | plumbing/transport: git, error on empty SSH_AUTH_SOCK
| * plumbing/transport: git, error on empty SSH_AUTH_SOCKMáximo Cuadros2017-02-212-3/+26
| |
* | *: update tests to meet new submodule fixtureMáximo Cuadros2017-02-212-4/+6
| |
* | plumbing/transport: client avoid panics on nil protocolMáximo Cuadros2017-02-212-16/+26
|/
* Merge pull request #278 from ajnavarro/improvement/move-cache-to-plumbingMáximo Cuadros2017-02-215-1/+216
|\ | | | | cache: move package to plumbing
| * cache: move package to plumbingAntonio Jesus Navarro Perez2017-02-215-1/+216
| | | | | | | | Because cache package is only intended to be used at internal level, we move it to the plumbing package.
* | rebase masterMáximo Cuadros2017-02-215-0/+1036
|\|
| * difftree for git.Trees (#273)Alberto Cortés2017-02-217-536/+1269
| | | | | | | | | | | | | | | | | | | | | | | | | | Last PR to fix #82: This PR modifies the difftree package itself. The old version extracted the files in both trees and compare them by hand. The new version turn the trees into merkletrie.Noders and call the merkletrie.Difftree function on them. How to review this PR: treenoder.go: defines the treeNoder type that wraps a git.Tree and implements merkletrie.Noder. change.go: defines the type of the output of a difftree operation. The type is the same as before, but I have moved it into its own file to keep the package organized. The old package defines the Action type too (insert, delete, modify), now, we reuse merkletrie.Action and it is no longer a field, but a method. change_adaptor.go: defines functions to turn merkletrie.Changes into difftree.Changes. difftree.go: before this patch this file holds all the logic to do a difftree, now it just turns the git.Trees into treeNoders, call merkletrie.difftree on them, and turns the resulting merkletrie.Changes into difftree.Changes. The only interesting piece of code here is that noders don't have the concept of mode (file permissions). The treenoder type codifies git.Tree modes into the merkletrie.Noder hash, so changes in the mode of a file are detected as modifications, just as the original git diff-tree command does.
| * plumbing/storer: add RemoveReferenceSantiago M. Mola2017-02-161-0/+1
| |
| * transport/file: fix race condition on test (#267)Alberto Cortés2017-02-151-45/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, the `TestClone` and `TestPush` tests of `transport/file` fail in travis. This is due to a race condition caused by an incorrect usage of `Cmd.Wait()` while reading from the output and error pipes of the command. This patch fixes the problem by using `Cmd.CombinedOutput()` instead of calling `Cmd.Start()` and `Cmd.Wait()` while reading from the output and error pipes. Details: From the `exec` package documentation: ``` Wait will close the pipe after seeing the command exit, so most callers need not close the pipe themselves; however, an implication is that it is incorrect to call Wait before all reads from the pipe have completed. For the same reason, it is incorrect to call Run when using StdoutPipe. ``` In our tests, the old `execAndGetOutput` function was creating two gorutines to read from the stderr and stdout pipes of the command and then call `Wait` on the command. This caused a race condition: when the `Wait` call finished before the gorutines have read from the pipes, they returned caused an error on `outErr`. The problem only happens sometimes on travis. To reproduce the problem locally, just add a call to time.Sleep(time.Second) to the gorutine before its `ioutil.ReadAll` call to delay them, then `Wait` will always finish before them, closing the pipes, and the gorutines will fail. The returned error detected by the test will be: ``` FAIL: server_test.go:55: ServerSuite.TestClone server_test.go:65: c.Assert(err, IsNil, Commentf("STDOUT:\n%s\nSTDERR:\n%s\n", stdout, stderr)) ... value *os.PathError = &os.PathError{Op:"read", Path:"|0", Err:0x9} ("read |0: bad file descriptor") ... STDOUT: STDERR: ```
| * transport/file: delete suite tmp dir at teardown (#266)Alberto Cortés2017-02-131-5/+12
| | | | | | | | | | | | | | | | | | | | | | The transport/file common suite test generates a temporal directory; It is used to store the go-git client command and some links to it: git-upload-pack and git-receive-pack. This directory is not deleted at the test teardown, so every time we run a test, we pollute "/tmp". This patch adds a teardown function for the suite that deletes the temporal directory. It also calls the teardown of the embedded fixtures.Suite, which is probably what we want also. I have also simplify the call to ioutil.TempDir as it already uses the default tmp dir if no dir is provided.
* | documentation and API improvementsMáximo Cuadros2017-02-218-593/+262
| |
* | format/index: sort the Entries before encodeMáximo Cuadros2017-02-133-4/+28
| |
* | plumbing/object: allow TreeIter return SubModule entriesMáximo Cuadros2017-02-134-6/+65
|/
* Merge pull request #258 from ajnavarro/fix/onf-decoderAntonio Navarro Perez2017-02-092-7/+65
|\ | | | | Fix missing objects if they where deltified using ref-delta
| * Fix missing objects if they where deltified using ref-deltaAntonio Jesus Navarro Perez2017-02-072-7/+65
| | | | | | | | | | - Deleted invalid logic that returned nil if an ref-delta was not found into the decoder index. This logic was missing objects if it was deltified using ref-deltas. - Now, to avoid that problem, index is mandatory to decode correctly a packfile of a specific type. Decoder.SetOffsets method now is called into the EncodedObjectIterator to avoid this problem.
* | Merge pull request #259 from smola/docsMáximo Cuadros2017-02-087-42/+83
|\ \ | | | | | | Improve documentation
| * | doc: improve object.Tag godoc.Santiago M. Mola2017-02-081-3/+7
| | |
| * | doc: add godoc to SignatureSantiago M. Mola2017-02-071-3/+6
| | |
| * | doc: improve godoc for WalkCommitHistory.Santiago M. Mola2017-02-071-1/+5
| | |
| * | doc: add object fields godocSantiago M. Mola2017-02-074-6/+21
| | |
| * | doc: improve object iterators godoc.Santiago M. Mola2017-02-076-27/+38
| | |
| * | doc: improve docs for object package.Santiago M. Mola2017-02-062-3/+7
| |/ | | | | | | | | | | | | | | * add package description. * add godoc to DecodeBlob. * clarify godoc for Object and Blob.
* | package plumbing documentation improvements (#248)Máximo Cuadros2017-02-0720-834/+637
| |
* | Add revision implementation (#139)Anthony HAMON2017-02-061-0/+11
|/
* documentation changesMáximo Cuadros2017-01-314-6/+6
|
* new srcd.works/go-git.v4 pathMáximo Cuadros2017-01-30115-257/+257
|
* new git fixture pathMáximo Cuadros2017-01-3019-19/+19
|
* rename billy importsMáximo Cuadros2017-01-302-5/+5
|
* delete old noder, create a new one in utils (#241)Alberto Cortés2017-01-309-1004/+0
|
* Fix some typos in plumbing docs (#244)Sergio Arbeo2017-01-3016-32/+32
|
* example: using new constructorsMáximo Cuadros2017-01-302-7/+7
|\
| * Repository.Progress moved as a field in *Options (#237)Máximo Cuadros2017-01-302-7/+7
| |
* | Worktree correct FileMode at index entriesMáximo Cuadros2017-01-301-11/+11
| |
* | object: modes in TreeEntry as os.FileMode, and not the git internalMáximo Cuadros2017-01-282-147/+155
| |
* | format/index: keep time.Time as zero, when decoded value is 0Máximo Cuadros2017-01-282-6/+12
| |
* | new repository constructors and worktreeMáximo Cuadros2017-01-281-1/+2
|/
* adds Tree method to Tree (#224)Alberto Cortés2017-01-262-5/+57
| | | | | | | | This patch adds a new method to the Tree object that allows you to get a child tree from a parent tree by its relative name. Before this patch, this was only possible with files, using the File method. The new Tree method has a similar signature to the old File method for consistency.
* packfile: cache undeltified objects to improve decode performance (#218)Antonio Navarro Perez2017-01-251-8/+33
| | | | | * Simple object cache that keeps in memory the last undeltified objects. When no more objects can be kept into memory, the oldest one is deleted (FIFO). This speeds up packfile operations preventing redundant seeks and decodes.
* transport/http: fix partial request with haves. Fix #216. (#221)Antonio Navarro Perez2017-01-257-8/+32
|
* transport: remove SetAuth, fixes #206 (#210)Anthony Weems2017-01-1719-120/+101
| | | | | * remove SetAuth functions, implement at NewUploadPackSession/NewReceivePackSession level. * propagate transport.Auth from Fetch/Pull/Clone options to the transport API.
* packfile/decoder: speed up packfile iterator when specific type (#200)Antonio Navarro Perez2017-01-122-1/+134
|
* packfile/scanner: reset zlib reader instead of new one (#201)Antonio Navarro Perez2017-01-121-5/+20
|
* plumbing: fix signature with `>` before `<` parsing (#204)Máximo Cuadros2017-01-092-2/+16
|
* server: add git server implementation (#190)Santiago M. Mola2017-01-0438-275/+1502
| | | | | | | | | | | | | | | * server: add generic server implementation (transport-independent), both for git-upload-pack and git-receive-pack. * server: move internal functions to internal/common. * cli: add git-receive-pack and git-upload-pack implementations. * format/packfile: add UpdateObjectStorage function, extracted from Remote. * transport: implement tranport RPC-like, only with git-upload-pack and git-receive-pack methods. Client renamed to Transport. * storer: add storer.Storer interface. * protocol/packp: add UploadPackResponse constructor with packfile. * protocol/packp: fix UploadPackResponse encoding, add tests. * protocol/packp/capability: implement All.
* remote: add Push (#178)Santiago M. Mola2016-12-194-25/+80
| | | | | | | | | | | | * remote: add Push. * add Push method to Remote. * add method Push to Repository. * examples: add push example. * requested changes * add tests, fixes