summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* status: nonexistent file with git_status_file()Jason Penny2011-07-091-0/+21
| | | | | Throws GIT_ENOTFOUND error if given a filename that is not in HEAD, index, nor the work tree.
* status: consolidate some test codeJason Penny2011-07-091-27/+27
| | | | Refactored copy of test repo to a function.
* status: handle subdirs for git_status_fileJason Penny2011-07-091-1/+11
|
* status: add subdir to test repoJason Penny2011-07-0915-2/+9
|
* status: get status for single fileJason Penny2011-07-091-1/+33
| | | | | Add git_status_file to be able to retrieve status of single file by supplying a path.
* status: get file statuses and run callbackJason Penny2011-07-091-3/+93
| | | | | Add git_status_foreach() to run a callback on each file passing the path and a status value.
* status: new test repoJason Penny2011-07-0935-1/+33
|
* status: get blob object id of file on diskJason Penny2011-07-094-0/+65
| | | | | | Add git_status_hashfile() to get blob's object id for a file without adding it to the object database or needing a repository at all. This functionality is similar to `git hash-object` without '-w'.
* Update tests/NAMINGJason Penny2011-07-091-0/+4
|
* Remove unused methodsVicent Marti2011-07-091-2/+2
| | | | | | | | | The direct-writes commit left some (slow) internals methods that were no longer needed. These have been removed. Also, the Reflog code was using the old `git_signature__write`, so it has been rewritten to use a normal buffer and the new `writebuf` signature writer. It's now slightly simpler and faster.
* odb: Direct writes are backVicent Marti2011-07-092-0/+61
| | | | | | | | | | | | | | | | | | | | | | DIRECT WRITES ARE BACK AND FASTER THAN EVER. The streaming writer to the ODB was an overkill for the smaller objects like Commit and Tags; most of the streaming logic was taking too long. This commit makes Commits, Tags and Trees to be built-up in memory, and then written to disk in 2 pushes (header + data), instead of streaming everything. This is *always* faster, even for big files (since the git_filebuf class still does streaming writes when the memory cache overflows). This is also a gazillion lines of code smaller, because we don't have to precompute the final size of the object before starting the stream (this was kind of defeating the point of streaming, anyway). Blobs are still written with full streaming instead of loading them in memory, since this is still the fastest way. A new `git_buf` class has been added. It's missing some features, but it'll get there.
* reflog: add API to read or write a reference logschu2011-07-091-0/+62
| | | | | | | | | | | So far libgit2 didn't support reference logs (reflog). Add a new git_reflog_* API for basic reading and writing of reflogs: * git_reflog_read * git_reflog_write * git_reflog_free Signed-off-by: schu <schu-github@schulog.org>
* reference_renaming: add additional testsnulltoken2011-07-071-3/+35
| | | | | | | Add some more test checking forced reference renaming. Signed-off-by: nulltoken <emeric.fermas@gmail.com> Acked-by: schu <schu-github@schulog.org>
* tag: add pattern based retrieval of list of tag namesnulltoken2011-07-071-0/+31
|
* test-core: Fix warning in uniq testVicent Marti2011-07-071-6/+17
|
* Fix MSVC compilation warningsnulltoken2011-07-071-1/+1
|
* vector: Timsort all of the thingsVicent Marti2011-07-071-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | Drop the GLibc implementation of Merge Sort and replace it with Timsort. The algorithm has been tuned to work on arrays of pointers (void **), so there's no longer a need to abstract the byte-width of each element in the array. All the comparison callbacks now take pointers-to-elements, not pointers-to-pointers, so there's now one less level of dereferencing. E.g. int index_cmp(const void *a, const void *b) { - const git_index_entry *entry_a = *(const git_index_entry **)(a); + const git_index_entry *entry_a = (const git_index_entry *)(a); The result is up to a 40% speed-up when sorting vectors. Memory usage remains lineal. A new `bsearch` implementation has been added, whose callback also supplies pointer-to-elements, to uniform the Vector API again.
* test: Abort when the temp workdir cannot be createdVicent Marti2011-07-071-4/+8
|
* Fix MSVC compilation warningsnulltoken2011-07-061-6/+6
|
* Merge pull request #296 from kiryl/index-optimizationVicent Martí2011-07-061-0/+23
|\ | | | | Index optimization
| * vector: implement git_vector_uniq()Kirill A. Shutemov2011-07-051-0/+23
| | | | | | | | | | | | | | The routine remove duplictes from the vector. Only the last added element of elements with equal keys remains in the vector. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* | refs: Cleanup reference renamingVicent Marti2011-07-064-12/+12
| | | | | | | | | | | | | | `git_futils_rmdir_r`: rename, clean up. `git_reference_rename`: cleanup. Do not use 3x4096 buffers on the stack or things will get ugly very fast. We can reuse the same buffer.
* | Remove duplicated recursive directory removal related codenulltoken2011-07-064-41/+12
| |
* | Fix windows specific issuesnulltoken2011-07-061-2/+3
| | | | | | | | | | - msvc compilation warnings - not released file handle that prevents file removal
* | reference_rename: git compliant reference renamingschu2011-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far libgit2 didn't handle the following scenarios: * Rename of reference m -> m/m * Rename of reference n/n -> n Fixed. Since we don't write reflogs, we have to delete any old reflog for the renamed reference. Otherwise git.git will possibly fail when it finds invalid logs. Reported-by: nulltoken <emeric.fermas@gmail.com> Signed-off-by: schu <schu-github@schulog.org>
* | Add tests for git_futils_rmdir_resurs()schu2011-07-061-0/+53
| | | | | | | | Signed-off-by: schu <schu-github@schulog.org>
* | Add test case checking renaming of a branch to a new name prefixed withschu2011-07-061-0/+32
| | | | | | | | | | | | | | the old name succeeds, e.g. refs/heads/foo -> refs/heads/foo/bar Reported-by: nulltoken <emeric.fermas@gmail.com> Signed-off-by: schu <schu-github@schulog.org>
* | Restore config10 test fileCarlos Martín Nieto2011-07-051-0/+7
|/ | | | | | | | Removing a section variable doesn't remove its section header. Overwrite the config10 file so there are no changes after the test is run. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Merge pull request #300 from carlosmn/gsoc2011/masterVicent Martí2011-07-053-0/+111
|\ | | | | A bit of networking
| * Add git_refspec_transform testCarlos Martín Nieto2011-06-261-0/+20
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Add refspec match testCarlos Martín Nieto2011-06-261-0/+19
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Add refspec0 testCarlos Martín Nieto2011-06-261-1/+20
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Add a test for remote parsingCarlos Martín Nieto2011-06-263-0/+53
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* | Add variable writing testsCarlos Martín Nieto2011-07-051-0/+28
| | | | | | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* | Add test for section header at end of fileCarlos Martín Nieto2011-07-052-0/+10
| | | | | | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* | Add tests for deleting a config varCarlos Martín Nieto2011-07-052-0/+31
| | | | | | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* | signature: straighten the creation of a signaturenulltoken2011-07-051-1/+36
| | | | | | | | | | - Fails on empty name and/or email - Trims leading and trailing spaces of name and email
* | signature: enhance relaxed parsing of bogus signaturesnulltoken2011-07-051-14/+105
| | | | | | | | Final fix for issue #278
* | t04-commit: add tests for git_signature__parseschu2011-07-051-0/+72
| | | | | | | | | | | | | | | | git_signature__parse used to be very strict about what's a well-formed signature. Add tests checking git_signature__parse can stick with "unexpected" signatures (IOW no author name and / or no email, etc). Signed-off-by: schu <schu-github@schulog.org>
* | fileutils: Finish dropping the old `prettify_path`Vicent Marti2011-07-052-235/+1
| |
* | fileops: Drop `git_fileops_prettify_path`Vicent Marti2011-07-051-4/+4
| | | | | | | | | | | | | | | | | | | | The old `git_fileops_prettify_path` has been replaced with `git_path_prettify`. This is a much simpler method that uses the OS's `realpath` call to obtain the full path for directories and resolve symlinks. The `realpath` syscall is the original POSIX call in Unix system and an emulated version under Windows using the Windows API.
* | fileops: CleanupVicent Marti2011-07-056-136/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaned up the structure of the whole OS-abstraction layer. fileops.c now contains a set of utility methods for file management used by the library. These are abstractions on top of the original POSIX calls. There's a new file called `posix.c` that contains emulations/reimplementations of all the POSIX calls the library uses. These are prefixed with `p_`. There's a specific posix file for each platform (win32 and unix). All the path-related methods have been moved from `utils.c` to `path.c` and have their own prefix.
* | cleanup: remove trailing spacesKirill A. Shutemov2011-07-017-12/+12
| | | | | | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* | filebuf: fix endless loop on writing buf > WRITE_BUFFER_SIZEKirill A. Shutemov2011-06-301-0/+14
| | | | | | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* | Hide ".git" directory on Windows upon creation of a non bare repositorynulltoken2011-06-291-0/+5
| | | | | | | | Directory which name starts with a dot are hidden on Linux platforms. This patch makes libgit2 behaves similarly on Windows.
* | refs: Remove duplicate rename methodVicent Marti2011-06-291-7/+7
| | | | | | | | `git_reference_rename` now takes a `force` flag
* | test: Properly show error messagesVicent Marti2011-06-282-1/+5
| |
* | test: Print last error message properlyVicent Marti2011-06-281-17/+10
| |
* | repo: Rename HEAD-related methodsVicent Marti2011-06-281-10/+10
| |
* | Merge pull request #279 from carlosmn/detached-orphanVicent Martí2011-06-281-0/+42
|\ \ | | | | | | Add detached and orphan convenience functions