| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
- If 'from' or 'to' are tree entries that aren't files, Files() method will return nil instead of object not found error.
- Added a test checking this using modules fixture.
|
| |
|
|\
| |
| | |
plumbing: Use ReadBytes() rather than ReadSlice()
|
| | |
|
| | |
|
|\ \
| |/
|/| |
plumbing/object: add WalkCommitHistoryPost func
|
| |
| |
| |
| |
| |
| |
| |
| | |
Also add a test. Make both the pre-order and post-order tests not sort
commits, to actually test the order in which the commit history is
walked.
Fixes #223.
|
| | |
|
|\ \
| |/
|/| |
git: Repository methods changes
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
To have a more consistent public API, we decided to rename some methods, and add others:
- Commit method renamed to CommitObject
- Commits method renamed to CommitObjects
- Tree method renamed to TreeObject
- Trees method renamed to TreeObjects
- Tags method renamed to TagObjects
- Tag method renamed to TagObject
- Added method Tags that returns tag references
- Added method Branches that returns branch references
- Added method Notes that returns note references
- Added BlobObject method
- Added BlobObjects method
Also, we added more functionality related to references:
- Added iterator to iterate References with a specific filter
Some notes:
- #298
|
| | |
|
|/
|
|
| |
To be able to fix #261 we will move again to gopkg.in before v4 stable release.
|
|
|
|
|
|
|
|
|
|
| |
Difftree hash comparisson was quite complex because the hashes of
deprecated files were diferent from the hashes of regular files. But
git's difftree really treat them as equal.
This patch fix this by making treenoder return the same hash for regular
files than for deprecated files; now the hash comparison function is
just a bytes.Equal call.
|
|\
| |
| | |
Return values of Read not checked (fix #65)
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
Remove TODOs from documentation
|
| | |
|
|\ \
| |/
|/| |
plumbing/revlist: input as a slice of hashes instead of commits
|
| |
| |
| |
| |
| |
| |
| | |
- Now the input of the method Objects inside revlist package is a slice of hashes instead of commits. Hashes can be from Blobs, Trees and Commits objects.
- ObjectStorer now is used to obtain the object content using hashes slice.
- This PR fix #222. Now a test into upload_pack_test.go file is not skipped anymore.
- Remove code from remote.go and server.go that is not necessary.
|
|\ \
| | |
| | | |
plumbing/cache: specify units in memory size (Fix #234)
|
| |/ |
|
|\ \
| |/
|/| |
plumbing: improve documentation (Fix #242)
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
- To avoid ciclic dependency errors, we move all the difftree files to object package.
- Added Diff method to Tree object.
|
|\ \
| | |
| | | |
plumbing/storer: referenceIterator now returns the error if any
|
| |/ |
|
| |
| |
| |
| | |
Fix issue #279.
|
|/ |
|
|\
| |
| | |
plumbing/transport: git, error on empty SSH_AUTH_SOCK
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
cache: move package to plumbing
|
| |
| |
| |
| | |
Because cache package is only intended to be used at internal level, we move it to the plumbing package.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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:
```
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
Fix missing objects if they where deltified using ref-delta
|
| |
| |
| |
| |
| | |
- 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.
|
|\ \
| | |
| | | |
Improve documentation
|
| | | |
|