summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* commit: safer commit creation with reference updatecmn/commit-create-safeCarlos Martín Nieto2014-04-304-23/+94
| | | | | | | | | | | | | | 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.
* Merge pull request #2306 from odcinek/development_cmakeVicent Marti2014-04-281-1/+1
|\ | | | | Make the build CMake 2.6 compatible
| * Make the build CMake 2.6 compatibleMarcin Sawicki2014-04-281-1/+1
|/
* Merge pull request #2301 from libgit2/cmn/pack-objects-memoryVicent Marti2014-04-272-1/+2
|\ | | | | Keep the deflate buffer from ballooning up
| * pack-objects: always write out the status in write_one()cmn/pack-objects-memoryCarlos Martín Nieto2014-04-261-0/+1
| | | | | | | | Make sure we set the output parameter to a value.
| * zstream: grow based on used memory rather than allocatedCarlos Martín Nieto2014-04-261-1/+1
|/ | | | | | | | | | | | | | | When deflating data, we might need to grow the buffer. Currently we add a guess on top of the currently-allocated buffer size. When we re-use the buffer, it already has some memory allocated; adding to that means that we always grow the buffer regardless of how much we need to use. Instead, increase on top of the currently-used size. This still leaves us with the allocated size of the largest object we compress, but it's a minor pain compared to unbounded growth. This fixes #2285.
* refdb: fix typo and wordingCarlos Martín Nieto2014-04-261-1/+1
|
* Merge pull request #2299 from mekishizufu/fix_leaksVicent Marti2014-04-252-8/+6
|\ | | | | Plug some leaks
| * Reset tests: Use sandboxed indexJiri Pospisil2014-04-251-6/+3
| |
| * Filter: Make sure to release local on errorJiri Pospisil2014-04-251-2/+3
|/
* Merge pull request #2284 from jacquesg/push-progress-callbackVicent Marti2014-04-2520-121/+182
|\ | | | | Fire progress and update tips callbacks also for pushes.
| * Verify update_tips callbacks in push test casesJacques Germishuys2014-04-211-35/+83
| |
| * Fire update_tips callback also for pushes.Jacques Germishuys2014-04-211-17/+29
| |
| * Correct argument order of git__calloc()Jacques Germishuys2014-04-211-1/+1
| |
| * It is safe to free() a NULL pointerJacques Germishuys2014-04-211-3/+1
| |
| * Don't redefine the same callback types, their signatures may changeJacques Germishuys2014-04-2116-21/+21
| |
| * Rename progress callback to sideband_progressJacques Germishuys2014-04-213-5/+5
| |
| * Check the return codes of remote callbacks.Jacques Germishuys2014-04-212-7/+10
| | | | | | | | The user may have requested that the operation be cancelled.
| * Fire progress callbacks also for pushes.Jacques Germishuys2014-04-202-37/+37
| | | | | | | | | | It's not very useful to only know that a pre-receive hook has declined a push, you probably want to know why.
* | Merge pull request #2297 from libgit2/rb/status-with-precomposed-changesVicent Marti2014-04-252-39/+191
|\ \ | | | | | | Improve test coverage of status with different core.precomposeunicode settings
| * | Improve docs for status rename detection limitsrb/status-with-precomposed-changesRussell Belfer2014-04-242-4/+32
| | | | | | | | | | | | 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-257-107/+211
|\ \ \ | | | | | | | | Improve stash and checkout for ignored + untracked items
| * | | Handle explicitly ignored dir slightly differentlyrb/stash-skip-submodulesRussell Belfer2014-04-241-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When considering status of untracked directories, if we find an explicitly ignored item, even if it is a directory, treat the parent as an IGNORED item. It was accidentally being treated as an EMPTY item because we were not looking into the ignored subdir.
| * | | Treat ignored, empty, and untracked dirs differentRussell Belfer2014-04-234-22/+39
| | | | | | | | | | | | | | | | | | | | | | | | In the iterator, distinguish between ignores and empty directories so that diff and status can ignore empty directories, but checkout and stash can treat them as untracked items.
| * | | Make checkout match diff for untracked/ignored dirRussell Belfer2014-04-226-99/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-224-12/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-243-14/+30
|\ \ \ \ | |_|/ / |/| | | Merge checkout strategy
| * | | merge: checkout default shouldn't clobber givenEdward Thomson2014-04-233-15/+14
| | | |
| * | | merge: default checkout strategy for should be SAFEEdward Thomson2014-04-232-1/+18
| | | |
* | | | Merge pull request #2295 from libgit2/cmn/fetchhead-quoteVicent Marti2014-04-243-1/+13
|\ \ \ \ | |/ / / |/| | | fetchhead: deal with quotes in branch names
| * | | fetchhead: deal with quotes in branch namesCarlos Martín Nieto2014-04-243-1/+13
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | 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-237-6/+452
|\ \ \ | | | | | | | | patch: emit deflated binary patches (optionally)
| * | | patch: emit binary patches (optionally)Edward Thomson2014-04-227-6/+452
| | | |
* | | | Merge pull request #2283 from phkelley/win32_fsVicent Marti2014-04-2322-491/+1549
|\ \ \ \ | | | | | | | | | | Win32: UTF-8 <-> WCHAR conversion overhaul
| * | | | React to feedback for UTF-8 <-> WCHAR and reparse workPhilip Kelley2014-04-239-39/+35
| | | | |
| * | | | Handle win32 reparse points properlyEdward Thomson2014-04-227-132/+966
| | | | |
| * | | | Win32: UTF-8 <-> WCHAR conversion overhaulPhilip Kelley2014-04-1918-431/+659
| | |_|/ | |/| |
* | | | Merge pull request #2289 from libgit2/rb/note-git-diff-index-behaviorVicent Marti2014-04-237-656/+404
|\ \ \ \ | |_|_|/ |/| | | Some doc and examples/diff.c changes
| * | | Replace math fns with simpler integer mathrb/note-git-diff-index-behaviorRussell Belfer2014-04-221-11/+23
| | | |
| * | | Use git_diff_get_stats in example/diff + refactorRussell Belfer2014-04-226-619/+340
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | Some doc and examples/diff.c changesRussell Belfer2014-04-223-84/+99
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was playing with "git diff-index" and wanted to be able to emulate that behavior a little more closely with the diff example. Also, I wanted to play with running `git_diff_tree_to_workdir` directly even though core Git doesn't exactly have the equivalent, so I added a command line option for that and tweaked some other things in the example code. This changes a minor output thing in that the "raw" print helper function will no longer add ellipses (...) if the OID is not actually abbreviated.
* | | Merge pull request #2282 from libgit2/cmn/remote-easier-bindVicent Marti2014-04-224-32/+76
|\ \ \ | | | | | | | | A few niceties for binding authors
| * | | transports: allow the creds callback to say it doesn't existCarlos Martín Nieto2014-04-223-32/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the credentials callback to return GIT_PASSTHROUGH to make the transports code behave as though none was set. This should make it easier for bindings to behave closer to the C code when there is no credentials callback set at their level.
| * | | remote: provide read access to the callback structureCarlos Martín Nieto2014-04-222-0/+18
|/ / / | | | | | | | | | | | | This should make it easier for bindings to dynamically override their own callbacks.
* | | Merge pull request #2287 from libgit2/rb/moar-coverity-fixesVicent Marti2014-04-224-18/+16
|\ \ \ | | | | | | | | Fix some issues from the last Coverity scan
| * | | Fix some coverity-found issuesRussell Belfer2014-04-214-18/+16
| | |/ | |/|
* | | Merge pull request #2286 from libgit2/rb/fix-reset-staged-deleteVicent Marti2014-04-222-5/+45
|\ \ \ | |/ / |/| | Fix reset for staged deletes