summaryrefslogtreecommitdiff
path: root/tests/t18-status.c
Commit message (Collapse)AuthorAgeFilesLines
* Removing test suites that have been ported to Clar:Ben Straub2012-03-311-455/+0
| | | | | | | | | | | | | | | | | * t00 / 6e86fb3 (mentioned in #406) * t01 / fc60c4a (mentioned in #406) * t03 / bcbabe6 * t04 / PR #606 * t05 / d96f2c3 * t06 / 6c106ee * t07 / 2ef582b * t08 / b482c42 * t09 / 9a39a36 * t10 / 00a4893 * t12 / 7c3a4a7 * t13 / 1cb9b31 * t17 / cdaa6ff (mentioned in #406) * t18 / efabc08
* Revert GIT_STATUS constants to avoid issuesRussell Belfer2012-03-021-3/+3
| | | | | | | | | This reverts the changes to the GIT_STATUS constants and adds a new enumeration to describe the type of change in a git_diff_delta. I don't love this solution, but it should prevent strange errors from occurring for now. Eventually, I would like to unify the various status constants, but it needs a larger plan and I just wanted to eliminate this breakage quickly.
* Clean up GIT_UNUSED macros on all platformsRussell Belfer2012-03-021-4/+4
| | | | | | | | | | | | | | | | | | | It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5 did not fix the GIT_USUSED behavior on all platforms. This commit walks through and really cleans things up more thoroughly, getting rid of the unnecessary stuff. To remove the use of some GIT_UNUSED, I ended up adding a couple of new iterators for hashtables that allow you to iterator just over keys or just over values. In making this change, I found a bug in the clar tests (where we were doing *count++ but meant to do (*count)++ to increment the value). I fixed that but then found the test failing because it was not really using an empty repo. So, I took some of the code that I wrote for iterator testing and moved it to clar_helpers.c, then made use of that to make it easier to open fixtures on a per test basis even within a single test file.
* Update diff to use iteratorsRussell Belfer2012-03-021-3/+3
| | | | | | | | | | | | | This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.
* Fix up status testsRussell Belfer2012-01-111-3/+9
|
* Use git_buf for path storage instead of stack-based buffersRussell Belfer2011-12-071-3/+4
| | | | | | | | | | | | | | | | | | | | This converts virtually all of the places that allocate GIT_PATH_MAX buffers on the stack for manipulating paths to use git_buf objects instead. The patch is pretty careful not to touch the public API for libgit2, so there are a few places that still use GIT_PATH_MAX. This extends and changes some details of the git_buf implementation to add a couple of extra functions and to make error handling easier. This includes serious alterations to all the path.c functions, and several of the fileops.c ones, too. Also, there are a number of new functions that parallel existing ones except that use a git_buf instead of a stack-based buffer (such as git_config_find_global_r that exists alongsize git_config_find_global). This also modifies the win32 version of p_realpath to allocate whatever buffer size is needed to accommodate the realpath instead of hardcoding a GIT_PATH_MAX limit, but that change needs to be tested still.
* Implement p_renameCarlos Martín Nieto2011-11-071-9/+9
| | | | | | Move the callers of git_futils_mv_atomic to use p_rename. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* *: correct and codify various file permissionsBrodie Rao2011-10-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following files now have 0444 permissions: - loose objects - pack indexes - pack files - packs downloaded by fetch - packs downloaded by the HTTP transport And the following files now have 0666 permissions: - config files - repository indexes - reflogs - refs This brings libgit2 more in line with Git. Note that git_filebuf_commit() and git_filebuf_commit_at() have both gained a new mode parameter. The latter change fixes an important issue where filebufs created with GIT_FILEBUF_TEMPORARY received 0600 permissions (due to mkstemp(3) usage). Now we chmod() the file before renaming it into place. Tests have been added to confirm that new commit, tag, and tree objects are created with the right permissions. I don't have access to Windows, so for now I've guarded the tests with "#ifndef GIT_WIN32".
* t18-status.c: fix unused warningsschu2011-09-241-3/+3
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Add some forgotten asserts in the status testsnulltoken2011-09-171-4/+4
|
* Fix a off-by-one error in the git_status_foreach testsnulltoken2011-09-171-1/+1
| | | | Provided the tests fail (which they should not) and the callback is invoked too many times, this prevents the tests from segfaulting.
* Revert changes to t18Vicent Marti2011-09-161-1/+36
| | | | ...Ops, I broke the old test when porting it to Clay.
* Add sample "Status" clay testsVicent Marti2011-09-161-36/+1
|
* status: enhance determination of statuses for a whole directorynulltoken2011-09-151-29/+230
| | | | | - Should increase performance through usage of a walker - No callback invocation for unaltered entries
* status: enhance determination of status for a single filenulltoken2011-09-151-0/+63
| | | | | | - fix retrieval of a file status when working against a newly initialized repository - reduce memory pressure - prevents a directory from being tested
* status: refactor the tests to remove some code duplicationnulltoken2011-07-121-54/+26
|
* reflog: Fix reflog writer/readernulltoken2011-07-101-2/+1
| | | | | | - Use a space to separate oids and signature - Enforce test coverage - Make test run in a temporary folder in order not to alter the test repository
* status: CleanupVicent Marti2011-07-091-1/+1
| | | | | | | | The `hashfile` function has been moved to ODB, next to `git_odb_hash`. Global state has been removed from the dirent call in `status.c`, because global state is killing the rainforest and causing global warming.
* 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: 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: get blob object id of file on diskJason Penny2011-07-091-0/+60
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'.