Commit Graph

8127 Commits

Author SHA1 Message Date
Edward Thomson
19c80a6fd1 stash_apply: provide its own options structure 2015-05-11 14:12:39 -04:00
Edward Thomson
249616685e stash: test checkout notify callbacks 2015-05-11 14:12:35 -04:00
Edward Thomson
12149a20ef stash apply: default to at least GIT_CHECKOUT_SAFE 2015-05-11 14:12:31 -04:00
Edward Thomson
f78bb2afb3 stash: return GIT_EMERGECONFLICT on merge conflict 2015-05-11 14:12:27 -04:00
Edward Thomson
958950b6e0 stash: document merge conflicts 2015-05-11 14:12:23 -04:00
Edward Thomson
f0957589ee stash: refactor to use merge_iterators 2015-05-11 14:12:19 -04:00
Edward Thomson
90f8408dac stash: ensure a reflog has entries 2015-05-11 14:12:16 -04:00
Edward Thomson
d0dd3fcee7 stash apply: check out a tree, not piecewise 2015-05-11 14:12:12 -04:00
Edward Thomson
7f26b1b9cf stash: use git_commit_summary for a summary 2015-05-11 14:12:09 -04:00
Edward Thomson
35d3976151 index: introduce git_index_read_index 2015-05-11 14:12:05 -04:00
Edward Thomson
73dce1f688 checkout: allow baseline to be specified as index
Allow the baseline to be specified as an index, so that users
need not write their index to a tree just to checkout with that
as the baseline.
2015-05-11 14:12:01 -04:00
Edward Thomson
9ebb5a3ff3 merge: merge iterators 2015-05-11 14:11:56 -04:00
Pierre-Olivier Latour
bf8dd3f53d Added git_stash_apply() and git_stash_pop() APIs 2015-05-11 14:11:53 -04:00
Carlos Martín Nieto
9cdd657887 Merge pull request #3104 from whoisj/optimal-buffer-size
Adjusting stream buffer size to 64KB
2015-05-09 13:11:46 +02:00
J Wyman
7eb7e03db8 Adjusting stream buffer size to 64KB
64K is optimal buffer size per https://technet.microsoft.com/en-us/library/cc938632.aspx
2015-05-07 08:50:12 -07:00
Carlos Martín Nieto
25f355cbed Merge pull request #3086 from yongthecoder/master
Android build doesn't need deps/regex
2015-05-06 18:39:39 +02:00
Carlos Martín Nieto
5b6292a77c Merge pull request #3100 from arthurschreiber/patch-5
Ensure frameworks are mentioned in libgit2.pc
2015-05-06 07:37:49 +02:00
Arthur Schreiber
7a5c755989 Ensure frameworks are mentioned in libgit2.pc
When building on Mac OS X, the `CoreFoundation` and `Security` frameworks where missing from `Libs.private` in the generated `libgit2.pc` file.
2015-05-05 22:36:24 +02:00
Carlos Martín Nieto
b162d97a4f config: plug a couple of leaks 2015-05-05 09:47:16 +02:00
Yong Li
57aa839caf Android build doesn't need deps/regex
deps/regex was included in Android build because Android NDK 4 has
a packaging bug and doesn't have the regular expression functions defined
in its libc.so. The bug has been fixed in subsequent Android NDK releases.

If it is still necessary to work around the bug in Android NDK 4, we
should consider to use an option like ANDROID_NDK_RELEASE or
ANDROID_NDK_RELEASE_NUM.
2015-05-04 09:41:34 -04:00
Carlos Martín Nieto
074d323f73 Merge pull request #3079 from ethomson/config
Configuration changes for handling multiple of the same sections
2015-05-04 15:23:40 +02:00
Carlos Martín Nieto
c3414d53df Merge pull request #3070 from ethomson/checkout_icase
Case insensitive checkout improvements
2015-05-04 14:59:08 +02:00
Edward Thomson
d6b7e40497 config: test all multivars are updated
If a multivar exists within two sections (of the same name)
then they should both be updated in a `set_multivar`.  Ensure
that this is the case.
2015-05-04 07:41:41 -05:00
Edward Thomson
0daf998de7 config: use wildcard in test instead of empty expr 2015-05-04 07:41:40 -05:00
Edward Thomson
63c0cc65bc config: cleanup some now-unused variables 2015-05-04 07:41:38 -05:00
Edward Thomson
9c26de0fd1 config: lock the file for write before reading
When writing a configuration file, we want to take a lock on the
new file (eg, `config.lock`) before opening the configuration file
(`config`) for reading so that we can prevent somebody from changing
the contents underneath us.
2015-05-04 07:41:37 -05:00
Ryan Roden-Corrent
5a70df9436 Test setting config var under duplicate header.
Add a test that exposes a bug in config_write.
It is valid to have multiple separate headers for the same config section, but
config_write will exit after finding the first matching section in certain
situations.
This test proves that config_write will duplicate a variable that already
exists instead of overwriting it if the variable is defined under a duplicate
section header.
2015-05-04 07:41:36 -05:00
Edward Thomson
2a950c945a config: write existing lines as-is when rewriting
When updating a configuration file, we want to copy the old data
from the file to preserve comments and funny whitespace, instead
of writing it in some "canonical" format.  Thus, we keep a
pointer to the start of the line and the line length to preserve
these things we don't care to rewrite.
2015-05-04 07:41:35 -05:00
Edward Thomson
bf99390eef config: examine whole file when writing
Previously we would try to be clever when writing the configuration
file and try to stop parsing (and simply copy the rest of the old
file) when we either found the value we were trying to write,
or when we left the section that value was in, the assumption being
that there was no more work to do.

Regrettably, you can have another section with the same name later
in the file, and we must cope with that gracefully, thus we read the
whole file in order to write a new file.

Now, writing a file looks even more than reading.  Pull the config
parsing out into its own function that can be used by both reading
and writing the configuration.
2015-05-04 07:41:33 -05:00
Edward Thomson
f79c7322a9 config: test overwriting cvar in multiple regions 2015-05-04 07:41:31 -05:00
Edward Thomson
7ee61b8ee3 config: ensure we can write to an empty file 2015-05-04 07:41:30 -05:00
Edward Thomson
cd79d99a4c checkout test: better case-insensitive test on Mac
On Mac OS, `realpath` is deficient in determining the actual filename
on-disk as it will simply provide the string you gave it if that file
exists, instead of returning the filename as it exists.  Instead we
must read the directory entries for the parent directory to get the
canonical filename.
2015-05-04 07:18:30 -05:00
Edward Thomson
f286e2715d status test: always test the new file path 2015-05-04 07:18:29 -05:00
Edward Thomson
64842d8756 checkout test: only run icase on icase platform 2015-05-04 07:18:29 -05:00
Edward Thomson
4beab1f8bb checkout: break case-changes into delete/add
When checking out with a case-insensitive working directory, we
want to change the case of items in the working directory to
reflect changes that occured in the checkout target.  Diff now
has an option to break case-changing renames into delete/add.
2015-05-04 07:18:28 -05:00
Edward Thomson
05f690122e checkout: remove blocking dir when FORCEd 2015-05-04 07:18:27 -05:00
Edward Thomson
3520c97057 Revert "Always checkout with case sensitive iterator"
This reverts commit 40d791545a.
2015-05-04 07:18:27 -05:00
Edward Thomson
6dfd8506b7 checkout test: ensure we write to casechanged dir
Ensure that on a case insensitive filesystem that we can checkout
into some folder 'FOLDER' that exists on disk, even if the target
of the checkout is a different case (eg 'folder').
2015-05-04 07:18:26 -05:00
Edward Thomson
431f98070f checkout test: ignore unstaged case-changing renames
On Windows, you might sloppily rewrite a file (or have a sloppy
text editor that does it for you) and accidentally change its
case.  (eg, "README" -> "readme").  Git ignores this accidental
case changing rename during checkout and will happily write the
new content to the file despite the name change.  We should, too.
2015-05-04 07:18:25 -05:00
Carlos Martín Nieto
cfc2e56d59 Merge pull request #3087 from ethomson/pr/3054
Performance Improvements to Status on Windows
2015-05-04 11:16:52 +02:00
Edward Thomson
72f8da9175 Merge pull request #3089 from volftomas/patch-2
Added call to git_libgit2_shutdown()
2015-05-02 10:51:24 -04:00
Tomas Paladin Volf
785990bead
Restructured to be nicer example
Code restructured to better represent best practice when
using libgit2.
2015-05-02 12:16:22 +02:00
Edward Thomson
ef23a82fa7 Merge pull request #3092 from techee/iconv_macports_fix2
Don't search iconv in /opt/local
2015-05-01 17:30:51 -04:00
Jiří Techet
b7df2e8bdd Don't search iconv in /opt/local
Since OpenSSL isn't used any more on OS X, there is no dependency
on any MacPorts library under /opt/local and there is no danger of
conflicts between MacPorts and system iconv. For this reason the
system iconv can always be used now.
2015-05-01 22:48:33 +02:00
Edward Thomson
be3f104967 diriter: actually use iconv on mac 2015-05-01 12:31:47 -04:00
Edward Thomson
cd39e4e2f3 git_buf_put_w: introduce utf16->utf8 conversion 2015-05-01 12:31:44 -04:00
Edward Thomson
f63a1b729b git_path_diriter: use FindFirstFile in win32
Using FindFirstFile and FindNextFile in win32 allows us to
use the directory information that is returned, instead of
us having to get the file attributes all over again, which
is a distinct cost savings on win32.
2015-05-01 12:31:40 -04:00
Edward Thomson
5c387b6c5a git_path_diriter: next shouldn't take path ptr
The _next method shouldn't take a path pointer (and a path_len
pointer) as 100% of current users use the full path and ignore
the filename.

Plus let's add some docs and a unit test.
2015-05-01 12:31:29 -04:00
Edward Thomson
7ef005f165 git_path_dirload_with_stat: moved to fs_iterator 2015-05-01 12:31:26 -04:00
Edward Thomson
ba8ef18a53 git_path_dirload_with_stat: use git_path_diriter 2015-05-01 12:31:21 -04:00