summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Don't always test composed-insensitive lookupsrb/unicode-branch-namesRussell Belfer2014-05-081-4/+4
| | | | | | Only on a filesystem that is composed/decomposed insensitive, should be testing that a branch can be looked up by the opposite form and still work correctly.
* Allow cl_repo_get_bool to work with missing keyRussell Belfer2014-05-081-1/+2
| | | | | | | One of the test helpers provides a quick way for looking up a boolean key. But if the key way missing completely, the check would actually raise an error. Given the way we use this helper, if the key is missing, this should just return false, I think.
* Pass unconverted data when iconv doesn't like itRussell Belfer2014-05-081-0/+56
| | | | | | | | | | | | | | When using Iconv to convert unicode data and iconv doesn't like the source data (because it thinks that it's not actual UTF-8), instead of stopping the operation, just use the unconverted data. This will generally do the right thing on the filesystem, since that is the source of the non-UTF-8 path data anyhow. This adds some tests for creating and looking up branches with messy Unicode names. Also, this takes the helper function that was previously internal to `git_repository_init` and makes it into `git_path_does_fs_decompose_unicode` which is a useful in tests to understand what the expected results should be.
* odb: ignore files in the objects dircmn/file-in-objects-dirCarlos Martín Nieto2014-05-051-0/+24
| | | | | | | | We assume that everything under GIT_DIR/objects/ is a directory. This is not necessarily the case if some process left a stray file in there. Check beforehand if we do have a directory and ignore the entry otherwise.
* Merge pull request #2308 from libgit2/rb/diff-update-index-stat-cacheVicent Marti2014-05-0214-80/+236
|\ | | | | Reduce excessive OID calculation for diff and stat
| * Some further sandboxing cleanups to testsRussell Belfer2014-05-025-40/+13
| | | | | | | | | | Trying to find other issues where tests may not clean up quite properly when they are through...
| * Improve handling of fake home directoryRussell Belfer2014-05-025-27/+58
| | | | | | | | | | | | | | | | | | | | There are a few tests that set up a fake home directory and a fake GLOBAL search path so that we can test things in global ignore or attribute or config files. This cleans up that code to work more robustly even if there is a test failure. This also fixes some valgrind warnings where scanning search paths for separators could end up doing a little bit of sketchy data access when coming to the end of search list.
| * Fix remaining init_options inconsistenciesRussell Belfer2014-05-021-2/+2
| | | | | | | | | | There were a couple of "init_opts()" functions a few more cases of structure initialization that I somehow missed.
| * Remove trace / add git_diff_perfdata struct + apiRussell Belfer2014-05-025-134/+73
| |
| * Get rid of redundant git_diff_options_init fnRussell Belfer2014-05-022-2/+2
| | | | | | | | Since git_diff_init_options was introduced, remove this old fn.
| * Add payloads, bitmaps to trace APIRussell Belfer2014-05-025-69/+64
| | | | | | | | | | | | | | | | | | This is a proposed adjustment to the trace APIs. This makes the trace levels into a bitmask so that they can be selectively enabled and adds a callback-level payload, plus a message-level payload. This makes it easier for me to a GIT_TRACE_PERF callbacks that are simply bypassed if the PERF level is not set.
| * Don't use trace if GIT_TRACE not definedRussell Belfer2014-05-022-0/+14
| |
| * Add GIT_STATUS_OPT_UPDATE_INDEX and use trace APIRussell Belfer2014-05-022-28/+129
| | | | | | | | | | | | This adds an option to refresh the stat cache while generating status. It also rips out the GIT_PERF stuff I had an makes use of the trace API to keep statistics about what happens during diff.
| * Add diff option to update index stat cacheRussell Belfer2014-05-021-0/+87
| | | | | | | | | | | | | | | | | | | | When diff is scanning the working directory, if it finds a file where it is not sure if the index entry matches the working dir, it will recalculate the OID (which is pretty expensive). This adds a new flag to diff so that if the OID calculation finds that the file actually has not changed (i.e. just the modified time was altered or such), then it will refresh the stat cache in the index so that future calls to diff will not have to check the oid again.
| * Skip diff oid calc when size definitely changedRussell Belfer2014-05-022-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | When we think the stat cache in the index seems valid and the size or mode of a file has definitely changed, then don't bother trying to recalculate the OID of the workdir bits to confirm that it is modified - just accept that it is modified. This can result in files that show as modified with no actual diff, but the behavior actually appears to match Git on the command line. This also includes a minor optimization to not perform a submodule lookup on the ".git" directory itself.
| * Add build option for diff internal statisticsRussell Belfer2014-05-021-0/+12
| |
* | Merge pull request #2310 from libgit2/cmn/commit-create-safeRussell Belfer2014-05-022-0/+13
|\ \ | |/ |/| commit: safer commit creation with reference update
| * commit: safer commit creation with reference updatecmn/commit-create-safeCarlos Martín Nieto2014-04-302-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The current version of the commit creation and amend function are unsafe to use when passing the update_ref parameter, as they do not check that the reference at the moment of update points to what the user expects. Make sure that we're moving history forward when we ask the library to update the reference for us by checking that the first parent of the new commit is the current value of the reference. We also make sure that the ref we're updating hasn't moved between the read and the write. Similarly, when amending a commit, make sure that the current tip of the branch is the commit we're amending.
* | Make ** pattern eat trailing slashrb/fix-starstar-againRussell Belfer2014-05-011-0/+18
|/ | | | This allows "foo/**/*.html" to match "foo/file.html"
* Reset tests: Use sandboxed indexJiri Pospisil2014-04-251-6/+3
|
* Merge pull request #2284 from jacquesg/push-progress-callbackVicent Marti2014-04-251-35/+83
|\ | | | | Fire progress and update tips callbacks also for pushes.
| * Verify update_tips callbacks in push test casesJacques Germishuys2014-04-211-35/+83
| |
* | Merge pull request #2297 from libgit2/rb/status-with-precomposed-changesVicent Marti2014-04-251-37/+164
|\ \ | | | | | | Improve test coverage of status with different core.precomposeunicode settings
| * | Improve docs for status rename detection limitsrb/status-with-precomposed-changesRussell Belfer2014-04-241-2/+5
| | | | | | | | | | | | and make tests empty on platforms without iconv support.
| * | Test toggling core.precomposeunicode yields renameRussell Belfer2014-04-241-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is an interesting difference with core Git here, though. Because libgit2 will do rename detection with the working directory, in the last case where the HEAD and the working directory both have the decomposed data and the index has the composed data, we generate a single status record with two renames whereas Git will generate one rename (head to index) and one untracked file.
| * | Test decomposed unicode renames work as expectedRussell Belfer2014-04-241-37/+92
| | |
* | | Merge pull request #2241 from libgit2/rb/stash-skip-submodulesVicent Marti2014-04-252-10/+40
|\ \ \ | | | | | | | | Improve stash and checkout for ignored + untracked items
| * | | Make checkout match diff for untracked/ignored dirRussell Belfer2014-04-222-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When diff finds an untracked directory, it emulates Git behavior by looking inside the directory to see if there are any untracked items inside it. If there are only ignored items inside the dir, then diff considers it ignored, even if there is no direct ignore rule for it. Checkout was not copying this behavior - when it found an untracked directory, it just treated it as untracked. Unfortunately, when combined with GIT_CHECKOUT_REMOVE_UNTRACKED, this made is seem that checkout (and stash, which uses checkout) was removing ignored items when you had only asked it to remove untracked ones. This commit moves the logic for advancing past an untracked dir while scanning for non-ignored items into an iterator helper fn, and uses that for both diff and checkout.
| * | | Failing test for stashing a buried ignored fileRussell Belfer2014-04-221-0/+13
| | | |
| * | | Make stash and checkout ignore contained reposRussell Belfer2014-04-222-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To emulate git, stash should not remove untracked git repositories inside the parent repo, and checkout's REMOVE_UNTRACKED should also skip over these items. `git stash` actually prints a warning message for these items. That should be possible with a checkout notify callback if you wanted to, although it would require a bit of extra logic as things are at the moment.
* | | | Merge pull request #2294 from ethomson/merge_checkout_strategyRussell Belfer2014-04-242-9/+27
|\ \ \ \ | |_|/ / |/| | | Merge checkout strategy
| * | | merge: checkout default shouldn't clobber givenEdward Thomson2014-04-232-10/+11
| | | |
| * | | merge: default checkout strategy for should be SAFEEdward Thomson2014-04-231-0/+17
| | | |
* | | | fetchhead: deal with quotes in branch namesCarlos Martín Nieto2014-04-242-0/+12
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | The current FETCH_HEAD parsing code assumes that a quote must end the branch name. Git however allows for quotes as part of a branch name, which causes us to consider the FETCH_HEAD file as invalid. Instead of searching for a single quote char, search for a quote char followed by SP, which is not a valid part of a ref name.
* | | Merge pull request #2291 from ethomson/patch_binaryVicent Marti2014-04-233-0/+284
|\ \ \ | | | | | | | | patch: emit deflated binary patches (optionally)
| * | | patch: emit binary patches (optionally)Edward Thomson2014-04-223-0/+284
| | |/ | |/|
* | | Merge pull request #2283 from phkelley/win32_fsVicent Marti2014-04-234-31/+637
|\ \ \ | | | | | | | | Win32: UTF-8 <-> WCHAR conversion overhaul
| * | | React to feedback for UTF-8 <-> WCHAR and reparse workPhilip Kelley2014-04-231-1/+1
| | | |
| * | | Handle win32 reparse points properlyEdward Thomson2014-04-222-0/+613
| | | |
| * | | Win32: UTF-8 <-> WCHAR conversion overhaulPhilip Kelley2014-04-192-31/+24
| |/ /
* | | Use git_diff_get_stats in example/diff + refactorRussell Belfer2014-04-222-391/+159
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This takes the `--stat` and related example options in the example diff.c program and converts them to use the `git_diff_get_stats` API which nicely formats stats for you. I went to add bar-graph scaling to the stats formatter and noticed that the `git_diff_stats` structure was holding on to all of the `git_patch` objects. Unfortunately, each of these objects keeps the full text of the diff in memory, so this is very expensive. I ended up modifying `git_diff_stats` to keep just the data that it needs to keep and allowed it to release the patches. Then, I added width scaling to the output on top of that. In making the diff example program match 'git diff' output, I ended up removing an newline from the sumamry output which I then had to compensate for in the email formatting to match the expectations. Lastly, I went through and refactored the tests to use a couple of helper functions and reduce the overall amount of code there.
* | Fix reset for staged deletesRussell Belfer2014-04-211-2/+37
|/
* Merge pull request #2279 from libgit2/rb/moar-eegnöre-fîxésVicent Marti2014-04-194-214/+227
|\ | | | | Fix several ignore and attribute file behavior bugs
| * Fix ignore difference from git with trailing /*Russell Belfer2014-04-181-0/+18
| | | | | | | | | | | | | | | | | | Ignore patterns that ended with a trailing '/*' were still needing to match against another actual '/' character in the full path. This is not the same behavior as core Git. Instead, we strip a trailing '/*' off of any patterns that were matching and just take it to imply the FNM_LEADING_DIR behavior.
| * Preload attribute files that may contain macrosRussell Belfer2014-04-181-39/+64
| | | | | | | | | | | | | | | | | | There was a latent bug where files that use macro definitions could be parsed before the macro definitions were loaded. Because of attribute file caching, preloading files that are going to be used doesn't add a significant amount of overhead, so let's always preload any files that could contain macros before we assemble the actual vector of files to scan for attributes.
| * Cleanup tests with helper functionsRussell Belfer2014-04-182-154/+83
| |
| * Pop ignore only if whole relative path matchesRussell Belfer2014-04-182-29/+70
| | | | | | | | | | | | | | | | | | | | | | When traversing the directory structure, the iterator pushes and pops ignore files using a vector. Some directories don't have ignore files, so it uses a path comparison to decide when it is right to actually pop the last ignore file. This was only comparing directory suffixes, though, so a subdirectory with the same name as a parent could result in the parent's .gitignore being popped off the list ignores too early. This changes the logic to compare the entire relative path of the ignore file.
* | Merge pull request #2213 from ethomson/safecrlfRussell Belfer2014-04-181-0/+80
|\ \ | |/ |/| Introduce core.safecrlf handling
| * Introduce core.safecrlf handlingEdward Thomson2014-04-071-0/+80
| |
* | Some memory leak fixesRussell Belfer2014-04-173-4/+10
| |