Commit Graph

5789 Commits

Author SHA1 Message Date
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
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
Ben Straub
b7bb086b1c Standardize layout of blame sample 2013-11-04 15:25:26 -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
Edward Thomson
dd64c71c26 Allow backend consumers to specify file mode 2013-11-04 14:50:25 -05: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
Vicent Martí
7f13edfdbb Merge pull request #1935 from ethomson/winerrs
preserve windows error numbers as well
2013-11-01 15:25:28 -07: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
Russell Belfer
8e5a8ef86f Convert git_index_read to have a "force" flag
This is a little more intuitive than the turned-around option that
I originally wrote.
2013-11-01 10:20:51 -07:00
Russell Belfer
4bf630b6ba Make diff and status perform soft index reload
This changes `git_index_read` to have two modes - a hard index
reload that always resets the index to match the on-disk data
(which was the old behavior) and a soft index reload that uses
the timestamp / file size information and only replaces the index
data if the file on disk has been modified.

This then updates the git_status code to do a soft reload unless
the new GIT_STATUS_OPT_NO_REFRESH flag is passed in.

This also changes the behavior of the git_diff functions that use
the index so that when an index is not explicitly passed in (i.e.
when the functions call git_repository_index for you), they will
also do a soft reload for you.

This intentionally breaks the file signature of git_index_read
because there has been some confusion about the behavior previously
and it seems like all existing uses of the API should probably be
examined to select the desired behavior.
2013-11-01 10:20:51 -07:00
Russell Belfer
3940310e29 Fix some of the glaring errors in GIT_DIFF_REVERSE
These changes fix the basic problem with GIT_DIFF_REVERSE being
broken for text diffs.  The reversed diff entries were getting
added to the git_diff correctly, but some of the metadata was kept
incorrectly in a way that prevented the text diffs from being
generated correctly.  Once I fixed that, it became clear that it
was not possible to merge reversed diffs correctly.  This has a
first pass at fixing that problem.  We probably need more tests
to make sure that is really fixed thoroughly.
2013-11-01 10:20:51 -07:00
Vicent Martí
567649f2ad Merge pull request #1916 from libgit2/simplify-examples
Fix examples to make the important stuff more obvious
2013-11-01 09:38:34 -07:00
Russell Belfer
948f00b4e7 Merge pull request #1933 from libgit2/vmg/gcc-warnings
Warnings for Windows x64 (MSVC) and GCC on Linux
2013-11-01 09:38:03 -07:00
Vicent Marti
d3ed2106c1 clar: Fix warnings in GCC/Linux 2013-11-01 17:36:09 +01:00
Vicent Marti
0bfa732342 iconv: Do not fake an API when iconv is not available 2013-11-01 17:36:09 +01:00
Vicent Marti
95352b7058 checkout: Remove unused vector 2013-11-01 17:36:09 +01:00
Vicent Marti
7334238696 array: Wrap array_alloc as a single statement 2013-11-01 17:36:09 +01:00
Vicent Marti
51a3dfb595 pack: __object_header always returns unsigned values 2013-11-01 17:36:09 +01:00
Linquize
3343b5ffd3 Fix warning on win64 2013-11-01 17:36:04 +01:00
Vicent Martí
ac5e507cec Merge pull request #1918 from libgit2/cmn/indexer-naming
indexer: remove the stream infix
2013-11-01 09:31:52 -07:00
Vicent Marti
b22593fb64 config_file: Style fixes 2013-11-01 17:30:41 +01:00
Vicent Marti
653ec420f9 Merge remote-tracking branch 'drodriguez/fix-remote-save' into development 2013-11-01 17:25:32 +01:00
Ben Straub
4f62d55968 Fix typos 2013-11-01 05:39:21 -07:00
Vicent Martí
ab44c62e54 Merge pull request #1928 from libgit2/parse-bad-urls
Improve bad URL handling
2013-11-01 04:22:12 -07:00
Carlos Martín Nieto
c44820c616 A few formatting changes for rocco
I'm not too happy about manually inserting < and > but those get
output as html tags otherwise.
2013-11-01 09:08:22 +01:00
Daniel Rodríguez Troitiño
376454d03d Set new multivar values using unmatcheable regexp.
Seems that regexp in Mac OS X and Linux were behaving
differently: while in OS X the empty string didn't
match any value, in Linux it was matching all of them,
so the the second fetch refspec was overwritting the
first one, instead of creating a new one.

Using an unmatcheable regular expression solves the
problem (and seems to be portable).
2013-11-01 00:08:52 +01:00
Daniel Rodríguez Troitiño
a71331ebc4 Fix memory leaks. 2013-11-01 00:08:52 +01:00
Daniel Rodríguez Troitiño
3793fa9b18 Fix saving remotes with several fetch/push ref specs.
At some moment git_config_delete_entry lost the ability to delete one entry of
a multivar configuration. The moment you had more than one fetch or push
ref spec for a remote you will not be able to save that remote anymore. The
changes in network::remote::remotes::save show that problem.

I needed to create a new git_config_delete_multivar because I was not able to
remove one or several entries of a multivar config with the current API.
Several tries modifying how git_config_set_multivar(..., NULL) behaved were
not successful.

git_config_delete_multivar is very similar to git_config_set_multivar, and
delegates into config_delete_multivar of config_file. This function search
for the cvar_t that will be deleted, storing them in a temporal array, and
rebuilding the linked list. After calling config_write to delete the entries,
the cvar_t stored in the temporal array are freed.

There is a little fix in config_write, it avoids an infinite loop when using
a regular expression (case for the multivars). This error was found by the
test network::remote::remotes::tagopt.
2013-11-01 00:08:52 +01:00
Russell Belfer
76120863a7 Update examples/README.md 2013-10-31 14:48:41 -07:00
Ben Straub
85c6730ce8 Format comments for use with docco 2013-10-31 14:35:32 -07:00
Ben Straub
048f837b2f Prevent another segfault from bad URL 2013-10-31 13:30:22 -07:00
Ben Straub
887df99f17 Test another bad URL 2013-10-31 13:29:16 -07:00