Commit Graph

1291 Commits

Author SHA1 Message Date
John Fultz
67db2bdeea Fix git_checkout_tree() to do index filemodes correctly on Windows.
git_checkout_tree() has some fallback behaviors for file systems
which don't have full support of filemodes.  Generally works fine,
but if a given file had a change of type from a 0644 to 0755 (i.e.,
you add executable permissions), the fallback behavior incorrectly
triggers when writing hte updated index.

This would cause a git_checkout_tree() command, even with the
GIT_CHECKOUT_FORCE option set, to leave a dirty index on Windows.

Also added checks to an existing test to catch this case.
2015-04-06 18:22:17 -05:00
Edward Thomson
de355f2341 Merge pull request #3011 from ethomson/filter_zero_tempbuf
Clear temporary buffer when filtering
2015-03-25 13:14:28 -04:00
Jacques Germishuys
7c2b9e063b Illustrate bad checkout on Windows 2015-03-25 10:20:47 -04:00
Edward Thomson
78db0239db squash some leaks 2015-03-24 20:58:00 +00:00
Edward Thomson
95d1624b8d Merge pull request #2947 from libgit2/cmn/notes-buf
note: use a git_buf to return the default namespace
2015-03-24 08:34:12 -04:00
Edward Thomson
89ba9f1acc Merge pull request #2967 from jacquesg/merge-whitespace
Allow merges of files (and trees) with whitespace problems/fixes
2015-03-18 13:17:04 -04:00
Carlos Martín Nieto
7568bdf4ab Merge pull request #2993 from ethomson/clar_update
clar: update to 08f434d
2015-03-18 05:04:50 +01:00
Carlos Martín Nieto
83ad46f726 Merge remote-tracking branch 'ethomson/submodule_8dot3' 2015-03-18 04:59:16 +01:00
Edward Thomson
4c2e6b1e87 Merge pull request #2985 from claudiuolteanu/patch-1
Lower case the include directive of windows header
2015-03-17 23:35:52 -04:00
Edward Thomson
08c29c4451 clar: update to 08f434d 2015-03-17 19:04:48 -04:00
Carlos Martín Nieto
385449b1df note: use a git_buf to return the default namespace
The caller has otherwise no way to know how long the string will be
allocated or ability to free it.

This fixes #2944.
2015-03-17 20:50:02 +01:00
Edward Thomson
9bbc8f350b Merge pull request #2962 from libgit2/cmn/reflog-annotated
Add annotated versions of ref-modying functions
2015-03-17 10:21:28 -04:00
Edward Thomson
828e595969 Merge pull request #2982 from libgit2/cmn/stream-check-ec
Don't ask for a stream's certificate unless it's encrypted
2015-03-17 09:44:56 -04:00
Edward Thomson
c07d02064d Merge pull request #2977 from pks-t/submodule-sync-url-fix
Fix git_submodule_sync writing URL to wrong key.
2015-03-17 09:44:25 -04:00
Claudiu Olteanu
118e6fdc8f Lower case the include directive of windows header
Since the Linux platform has a case sensitive file system, the header name should be lower case for cross compiling purposes. (On Linux, the mingw header is called ```windows.h```).
2015-03-16 23:08:16 +02:00
Carlos Martín Nieto
29e7ae5d81 Add failing test for cert callback with non-ecrypted stream
When we have an HTTP stream and have set the certificatre check
callback, we currently fail as we ask the unencrypted stream for its
certificate.
2015-03-16 19:39:05 +01:00
Carlos Martín Nieto
a5815a2afb Add tests for the annotated versions of ref-modifying functions
This also brings the soft-reset tests back to life. The function name
was missing an underscore, meaning they had not been running.
2015-03-16 16:57:30 +01:00
Jacques Germishuys
13de936316 Collapse whitespace flags into git_merge_file_flags_t 2015-03-16 09:53:27 +02:00
Jacques Germishuys
f29dde6828 Renamed git_merge_options 'flags' to 'tree_flags' 2015-03-16 09:53:27 +02:00
Jacques Germishuys
0f24cac2b9 Added tests to merge files and branches with whitespace problems and fixes 2015-03-16 09:53:27 +02:00
Carlos Martín Nieto
e5e2c11d5d Put back the number of expected references to 6 from the test repo
This was but down to 5 when GitHub made a change to their server which
made them stop honouring the include-tag request.

This has recently been corrected, so we can bring it back up to six.
2015-03-13 17:52:07 +01:00
Patrick Steinhardt
e6903ea278 Fix git_submodule_sync writing URL to wrong key.
Currently git_submodule_sync writes the submodule's URL to the
key 'branch.<REMOTE_NAME>.remote' while the reference
implementation of `git submodule sync` writes to
'remote.<REMOTE_NAME>.url', which is the intended behavior
according to git-submodule(1).
2015-03-12 16:05:07 +01:00
Carlos Martín Nieto
15f581747c Merge commit 'refs/pull/2879/head' of ssh://github.com/libgit2/libgit2 2015-03-11 17:55:39 +01:00
Carlos Martín Nieto
522df1cf1d Merge pull request #2970 from ethomson/inmemory_bare
"In-memory" repos are bare by default
2015-03-11 03:03:54 +01:00
Edward Thomson
70c735e190 repository_new: test its bareness 2015-03-10 16:49:24 -04:00
Pierre-Olivier Latour
b5ab878f4c Fixed build warning 2015-03-08 14:09:50 -07:00
Carlos Martín Nieto
d578b45f3f refdb: use the same id for old and new when renaming a reference
When we rename a reference, we want the old and new ids to be the same
one (as we did not change it). The normal code path looks up the old id
from the current value of the brtanch, but by the time we look it up, it
does not exist anymore and thus we write a zero id.

Pass the old id explicitly instead.
2015-03-08 16:50:27 +01:00
Edward Thomson
01c3b184d3 Merge pull request #2961 from ethomson/filter_relative_paths
Filter relative paths
2015-03-06 16:52:07 -05:00
Edward Thomson
0b3dd8fbed filter::file tests: test filter_list_apply_to_file
Test that filter_list_apply_to_file works and can accept repo-relative
paths.
2015-03-06 15:16:05 -05:00
nulltoken
7eb7673406 branch: fix generated reflog message upon renaming 2015-03-04 22:09:49 +01:00
nulltoken
015d4b7b38 branch: fix generated reflog message upon creation 2015-03-04 22:09:44 +01:00
Carlos Martín Nieto
bdf0e73450 Merge pull request #2932 from jeffhostetler/jeffhostetler/big_clone_crash
Fix crash in git_clone on extremely large repos
2015-03-04 14:55:56 +01:00
Edward Thomson
83fe60fa1b libgit2_shutdown: clear err message on shutdown
Clear the error message on git_libgit2_shutdown for all versions of
the library (no threads and Win32 threads).  Drop the giterr_clear
in clar, as that shouldn't be necessary.
2015-03-04 14:48:46 +01:00
Carlos Martín Nieto
814d86bfe3 Merge pull request #2886 from jeffhostetler/jeffhostetler/clar_trace
Set up git_trace in clar test suite.
2015-03-04 14:32:23 +01:00
Carlos Martín Nieto
c69c042e0e Merge pull request #2945 from ethomson/empty_hashsig_heap
diff_tform: don't compare empty hashsig_heaps
2015-03-04 12:47:59 +01:00
Edward Thomson
f78d9b6cfe diff_tform: account for whitespace options
When comparing seemingly blank files, take whitespace options into
account.
2015-03-04 00:01:34 -05:00
Carlos Martín Nieto
fe21d708b0 Plug a few leaks 2015-03-04 00:29:37 +01:00
Edward Thomson
a212716fc3 diff_tform: don't compare empty hashsig_heaps
Don't try to compare two empty hashsig_heaps.
2015-03-03 18:19:42 -05:00
Carlos Martín Nieto
9a97f49e3a config: borrow refcounted references
This changes the get_entry() method to return a refcounted version of
the config entry, which you have to free when you're done.

This allows us to avoid freeing the memory in which the entry is stored
on a refresh, which may happen at any time for a live config.

For this reason, get_string() has been forbidden on live configs and a
new function get_string_buf() has been added, which stores the string in
a git_buf which the user then owns.

The functions which parse the string value takea advantage of the
borrowing to parse safely and then release the entry.
2015-03-03 18:35:12 +01:00
Carlos Martín Nieto
76f034180a Remove swp files 2015-03-03 17:04:38 +01:00
Edward Thomson
018fdbb580 Merge pull request #2913 from ethomson/stash_fixup
stash: correctly stash wd modified/index deleted
2015-03-03 10:08:28 -05:00
Jeff Hostetler
e5cf1c704c Converted cl_perf_timer to use git__timer internally. 2015-03-03 09:57:50 -05:00
Jeff Hostetler
7e9b21aa2a Fix p_ftruncate to handle big files for git_clone 2015-03-03 08:47:44 -05:00
Carlos Martín Nieto
4e498646b6 repository: remove log message override for switching the active branch
We want to use the "checkout: moving from ..." message in order to let
git know when a change of branch has happened. Make the convenience
functions for this goal write this message.
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
412a380888 push: remove reflog message override
We always use "update by push".
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
6bfb990dc7 branch: don't accept a reflog message override
This namespace is about behaving like git's branch command, so let's do
exactly that instead of taking a reflog message.

This override is still available via the reference namespace.
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
23a17803b6 reset: remove reflog message override
This function is meant to simulate what git does in the reset command,
so we should include the reflog message in that.
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
659cf2029f Remove the signature from ref-modifying functions
The signature for the reflog is not something which changes
dynamically. Almost all uses will be NULL, since we want for the
repository's default identity to be used, making it noise.

In order to allow for changing the identity, we instead provide
git_repository_set_ident() and git_repository_ident() which allow a user
to override the choice of signature.
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
99b68a2aec Merge pull request #2908 from ethomson/safe_create
Allow checkout to handle newly cloned repositories, remove `GIT_CHECKOUT_SAFE_CREATE`
2015-03-03 13:47:13 +01:00
Jeff Hostetler
9a859ef55a Added cl_perf_timer. Updated global trace to include timers. 2015-03-02 09:21:55 -05:00