Commit Graph

6863 Commits

Author SHA1 Message Date
Vicent Martí
74e06c05b5 Merge pull request #1945 from libgit2/ntk/fix/merge_leaks
Plug git_merge() related leaks
2013-11-05 08:32:09 -08:00
nulltoken
8d22773f4b Plug git_merge() related leaks 2013-11-05 17:30:11 +01:00
Vicent Martí
453e6b3ec0 Merge pull request #1007 from ethomson/merge
merge!
2013-11-05 07:25:19 -08:00
Edward Thomson
039db728f3 merge branch into current, updating workdir 2013-11-05 10:00:39 -05:00
Vicent Martí
ae26c4b80f Merge pull request #1943 from libgit2/ntk/fix/leaks
Fix leaks
2013-11-05 06:55:29 -08:00
Vicent Martí
c82f7f8e99 Merge pull request #1938 from libgit2/cmn/branch-iterator
branch: move from foreach to an iterator
2013-11-05 06:55:16 -08:00
nulltoken
61080a959d Fix leaks 2013-11-05 15:10:02 +01:00
Vicent Martí
ffd040532a Merge pull request #1941 from libgit2/rb/preserve-iterator-error
Preserve error messages during file system iterator cleanup
2013-11-05 06:05:32 -08:00
Carlos Martín Nieto
8ec889a45f branch: move from foreach to an iterator
Create a git_branch_iterator type which is equivalent to the foreach but
lets us write loops instead of callbacks.

Since the introduction of git_reference_shorthand(), the added value of
passing the name is reduced.
2013-11-05 14:58:16 +01:00
Vicent Marti
1eab9f0e32 error: Simplify giterr_detach 2013-11-05 14:56:10 +01:00
Vicent Martí
b7fbfbb21f Merge pull request #1942 from libgit2/fix/config_propagate_error
Propagate ELOCKED error when updating the config
2013-11-05 05:39:48 -08:00
nulltoken
e8162fd091 Propagate ELOCKED error when updating the config 2013-11-05 14:03:51 +01:00
Edward Thomson
3ae66ef1af Merge pull request #1940 from ethomson/filebuf_umask
Take umask into account in filebuf_commit
2013-11-05 04:48:45 -08:00
Edward Thomson
1d3a8aeb4b move mode_t to filebuf_open instead of _commit 2013-11-04 22:33:05 -05:00
Edward Thomson
f966acd133 Take umask into account in filebuf_commit 2013-11-04 22:32:50 -05:00
Ben Straub
ac72051afa Fix ssh.c compile 2013-11-04 19:09:30 -08:00
Ben Straub
b47949254e blame sample: usage comment 2013-11-04 15:54:11 -08:00
Ben Straub
ea8ce3d17e Fix warnings 2013-11-04 15:50:33 -08:00
Ben Straub
e6b85be7cf Reorganize and doc-commentify blame sample. 2013-11-04 15:48:35 -08:00
Russell Belfer
3b259cbd1a Preserve file error in iterator
When the filesystem iterator encounters an error with a file, it
returns the error but because of the cleanup code, it was in some
cases erasing the error message.  This uses the giterr_detach API
to make sure that the actual error message is restored after the
cleanup code has been run.
2013-11-04 15:47:35 -08:00
Russell Belfer
d6c6016966 Add giterr_detach API to get and clear error
There are a number of cases where it is convenient to be able to
fetch and "claim" the current error string, clearing the error.
This is helpful when you need to call some code that may alter
the error and you want to restore it later on and/or report it via
some other mechanism.
2013-11-04 15:45:31 -08:00
Ben Straub
b7bb086b1c Standardize layout of blame sample 2013-11-04 15:25:26 -08:00
Ben Straub
2d1feaa2c7 Compile HTTP parser on win32 (for url parsing) 2013-11-04 15:03:44 -08:00
Vicent Martí
0e1115d287 Merge pull request #1939 from ethomson/readwrite_odb
Allow backend consumers to specify file mode
2013-11-04 12:16:14 -08:00
Ben Straub
16bffd1c26 Unescape url-encoded usernames and passwords 2013-11-04 12:04:17 -08:00
Edward Thomson
dd64c71c26 Allow backend consumers to specify file mode 2013-11-04 14:50:25 -05:00
Ben Straub
c227c173b8 Use http_parser_parse_url to parse urls 2013-11-04 11:42:14 -08:00
Russell Belfer
fb6b0e019e Merge pull request #1317 from libgit2/blame
Blame Canada
2013-11-04 10:44:59 -08:00
Vicent Martí
a605bbd9b4 Merge pull request #1934 from libgit2/relicense-examples
Relicense examples under CC0
2013-11-04 10:14:22 -08:00
Vicent Martí
44acdd1f9a Merge pull request #1937 from scunz/checkout_assert
Don't assert in git_checkout_tree
2013-11-04 08:09:58 -08:00
Vicent Martí
5a0b88036f Merge pull request #1929 from libgit2/rb/misc-diff-fixes
Fix some observed problems with incorrect diffs
2013-11-04 08:05:55 -08:00
Carlos Martín Nieto
becb13c0f0 examples: doc update
Update the explanation to reflect our use of git_status_list_new() and
make the breaks in rocco more meaningful.

Clarify why GIT_STATUS_CURRENT and index_to_workdir don't always imply
each other. Fixes #1740.
2013-11-03 16:20:24 +01:00
Carlos Martín Nieto
a7a64d2cad remote: don't write too much when dealing with multivars
We used to move `data_start` forward, which is wrong as that needs to
point to the beginning of the buffer in order to perform size
calculations.

Introduce a `write_start` variable which indicates where we should start
writing from, which is what the `data_start` was being wrongly reused to
be.
2013-11-02 18:54:55 +01:00
Carlos Martín Nieto
187009e253 Fix a leak in the diff tests 2013-11-02 18:34:51 +01:00
Ben Straub
6cb831bd56 Replace copyright topmatter in example files 2013-11-02 05:33:26 -07:00
Sascha Cunz
7b3959b227 Checkout: git_checkout_head is git_checkout_tree without a treeish
The last commit taught git_checkout_tree to actually do something
meaningfull, when treeish was NULL. This lets us rewrite
git_checkout_head to simply call git_checkout_tree without giving it a
treeish.
2013-11-02 03:45:32 +00:00
Sascha Cunz
352214416c Checkout: Don't assert if treeish is NULL
In git_checkout_tree, the first check tests if either repo or treeish is
NULL and says that eithor of them has to have a valid value. But there
is no code to handle the treeish == NULL case.

So, do something meaningful in that case: use HEAD instead.
2013-11-02 03:43:34 +00:00
Sascha Cunz
10749f6ca2 Checkout: Unifiy const-ness of opts parameter
Since all 3 checkout APIs perform the same operation with the options,
all of them should use the same const-ness.
2013-11-02 03:20:05 +00:00
Ben Straub
56c1cda28a Clarify parsing issues and errors 2013-11-01 19:22:43 -07:00
Ben Straub
7e0359084e Streamline url-parsing logic. 2013-11-01 15:29:25 -07:00
Vicent Martí
7f13edfdbb Merge pull request #1935 from ethomson/winerrs
preserve windows error numbers as well
2013-11-01 15:25:28 -07:00
Carlos Martín Nieto
af613ecd44 remote: store dwimed refspecs separately
This allows us to add e.g. "HEAD" as a refspec when none are given
without overwriting the user's data.
2013-11-01 22:48:09 +01:00
Carlos Martín Nieto
968c7d072a remote: create FETCH_HEAD with a refspecless remote
When downloading the default branch due to lack of refspecs, we still
need to write out FETCH_HEAD with the tip we downloaded, unfortunately
with a format that doesn't match what we already have.
2013-11-01 22:47:06 +01:00
Carlos Martín Nieto
a7382aa28c remote: give up after 256 failures to find a common object
This avoids sending our whole history bit by bit to the remote in cases
where there is no common history, just to give up in the end.

The number comes from the canonical implementation.
2013-11-01 22:47:06 +01:00
Carlos Martín Nieto
2f03050f4f remote: download HEAD when no refspecs are given
The correct behaviour when a remote has no refspecs (e.g. a URL from the
command-line) is to download the remote's HEAD. Let's do that.

This fixes #1261.
2013-11-01 22:47:06 +01:00
Edward Thomson
c2408a698a preserve windows error numbers as well 2013-11-01 17:27:07 -04:00
Russell Belfer
3e57069e82 Fix --assume-unchanged support
This was never really working right because we were checking the
wrong flag and not checking it in all the places that we need to
be checking it.  I finally got around to writing a test and adding
actual support for it.
2013-11-01 13:49:43 -07:00
Russell Belfer
e7c85120ea More tests and fixed for merging reversed diffs
There were a lot more cases to deal with to make sure that our
merged (i.e. workdir-to-tree-to-index) diffs were matching the
output of core Git.
2013-11-01 11:39:37 -07:00
Ben Straub
dcfdb977d0 Relicense examples under CC0 2013-11-01 10:51:12 -07:00
Russell Belfer
a5c16f3cfb Add git_diff_options_init helper
Sometimes the static initializer for git_diff_options cannot be
used and since setting them to all zeroes doesn't actually work
quite right, this adds a new helper for that situation.

This also adds an explicit new value to the submodule settings
options to be used when those enums need static initialization.
2013-11-01 10:20:51 -07:00