Commit Graph

5146 Commits

Author SHA1 Message Date
Russell Belfer
c77342ef1c Use pool for loose refdb string allocations
Instead of using lots of strdup calls, this adds a memory pool to
the loose refs iteration code and uses it for keeping track of the
loose refs array.  Memory usage could probably be reduced even
further by eliminating the vector and just scanning by adding the
strlen of each ref, but that would be a more intrusive changes.

This also updates the error handling to be more thorough about
checking for failed allocations, etc.
2013-07-22 11:20:34 -07:00
Russell Belfer
b71071313f git_reference_next_name must match git_reference_next
The git_reference_next API silently skips invalid references when
scanning the loose refs.  The git_reference_next_name API should
skip the same ones even though it isn't creating the reference
object.

This adds a test with a an invalid loose reference and makes sure
that both APIs skip the same entries and generate the same results.
2013-07-22 11:01:19 -07:00
Martin Woodward
1cd9dc29b7 Merge pull request #1743 from ethomson/readme
Clarify when to use github issues
2013-07-19 11:14:22 -07:00
Edward Thomson
bef59b1be4 Update README.md 2013-07-19 12:56:47 -05:00
Ben Straub
97309dd025 Merge pull request #1726 from crazymaster/development
git_buf_text_gather_stats doesn't work for multi-byte characters
2013-07-19 10:43:53 -07:00
Edward Thomson
41a93cc6e5 Clarify when to use github issues
Suggest that github issues are to be used for bug reports, while questions about usage should be directed to StackOverflow.
2013-07-19 12:43:08 -05:00
Ben Straub
847b8e0e44 Merge pull request #1742 from martinwoodward/Refresh-Readme
Refresh readme and contributing guidance
2013-07-19 10:29:47 -07:00
Martin Woodward
6ca83665c7 Update contributing guidance to explain PR flow
Updating the contributing guidance to explain a bit more about how we use
PR's
2013-07-19 18:20:58 +01:00
Martin Woodward
3e3d332b4c Tidy up the methods of contacting the project
Updated the methods of getting involved with the project and asking
questions.
2013-07-19 18:04:11 +01:00
Ben Straub
275d8d55b2 Typo 2013-07-18 09:37:59 -07:00
Vicent Martí
794003650e Merge pull request #1736 from ben/default-to-cdecl
Switch default calling convention to cdecl
2013-07-18 06:26:25 -07:00
Ben Straub
99a9c86cb6 Merge pull request #1722 from libgit2/ntk/fix/issue_1722
git_revparse_ext: should return a NULL reference  when the revparse expression doesn't lead to a reference
2013-07-17 20:08:15 -07:00
Vicent Martí
d2db351cf6 Merge pull request #1735 from ethomson/ignored_are_not_rename_candidates
don't include ignored as rename candidates
2013-07-17 16:12:15 -07:00
Edward Thomson
d55bed1a25 don't include ignored as rename candidates 2013-07-17 16:55:00 -05:00
Ben Straub
e49dc6872d Switch default calling convention to cdecl. 2013-07-17 14:06:31 -07:00
Ben Straub
4e05fa7db4 Merge pull request #1731 from alindeman/patch-1
Small grammar fix in docs
2013-07-15 20:45:18 -07:00
Andy Lindeman
51b0397a66 Small grammar fix in docs 2013-07-15 23:40:57 -04:00
Vicent Martí
f538515079 Merge pull request #1728 from ivoire/small_fixes
Small fixes
2013-07-15 09:45:04 -07:00
Vicent Martí
3f8086e069 Merge pull request #1729 from tiennou/remote-owner
Add `git_remote_owner`.
2013-07-15 09:44:02 -07:00
Etienne Samson
85e1eded6a Add git_remote_owner 2013-07-15 16:31:25 +02:00
Rémi Duraffort
c6451624c4 Fix some more memory leaks in error path 2013-07-15 16:29:18 +02:00
Rémi Duraffort
050af8bbe0 pack: fix memory leak in error path 2013-07-15 16:29:13 +02:00
Rémi Duraffort
8d6ef4bf78 index: fix potential memory leaks 2013-07-15 16:29:09 +02:00
Rémi Duraffort
9146f1e57e repository: clarify assignment and test order 2013-07-15 16:29:00 +02:00
crazymaster
d0b25d9dff Fix 2013-07-15 08:14:00 +09:00
crazymaster
2185dd6f99 Fix typo 2013-07-15 08:06:09 +09:00
crazymaster
b74d4478df Fix the initial line 2013-07-15 07:44:08 +09:00
crazymaster
19bee769d4 Revert "Replace Japanese characters with the encoded hexadecimal values"
This reverts commit a91e4d6b21.
2013-07-15 07:39:16 +09:00
crazymaster
a91e4d6b21 Replace Japanese characters with the encoded hexadecimal values 2013-07-15 07:30:18 +09:00
Russell Belfer
351733128c Merge pull request #1727 from alindeman/lookup-object-doc-fix
Fixes return type documentation
2013-07-14 15:16:08 -07:00
Andy Lindeman
960431c380 Fixes return type documentation 2013-07-14 18:08:54 -04:00
crazymaster
6550565af3 Fix gather_stats 2013-07-14 21:08:45 +09:00
crazymaster
d6d34cd0f4 Add test for multi-byte characters 2013-07-14 21:07:40 +09:00
nulltoken
80fd31faf7 revparse: Don't return a reference when asked for a git object
Fix #1722
2013-07-13 16:07:10 +02:00
Vicent Martí
1662158cf9 Merge pull request #1725 from libgit2/ntk/fix/leaks
Plug some memory leaks
2013-07-13 06:18:24 -07:00
nulltoken
d6cb13d743 tests: Fix memory leak 2013-07-13 14:14:43 +02:00
nulltoken
b3a559ddce submodule: Fix memory leaks 2013-07-13 14:14:40 +02:00
Vicent Martí
3a025b97ff Merge pull request #1724 from ethomson/cmake_vs
header files show up in vs and xcode
2013-07-12 17:03:57 -07:00
Edward Thomson
cdacd3d931 header files show up in vs 2013-07-12 16:53:00 -05:00
Vicent Martí
ed0be48b93 Merge pull request #1721 from ethomson/config_paths
preload configuration paths
2013-07-11 15:36:03 -07:00
Edward Thomson
0a1c8f55b3 preload configuration paths 2013-07-11 17:17:53 -05:00
Vicent Martí
f2de67d589 Merge pull request #1719 from libgit2/arrbee/threading-primitives
Update git__swap threading primitive
2013-07-11 11:27:57 -07:00
Russell Belfer
584f2d3013 Fix warnings on Win64 2013-07-11 11:04:42 -07:00
Russell Belfer
814de0bcab Update git__swap thread helper
This makes git__swap use the __sync_lock_test_and_set primitive
with GCC and the InterlockedExchangePointer primitive with MSVC.
Previously is used compare_and_swap in a way that was probably
unintuitive for most thinking (i.e. it could fail to swap in the
value if another thread raced in).  Now it will always succeed
and the last thread to run in a race will win instead of the
first thread.

This also fixes up a little confusion between volatile void **
and void * volatile * that came up with the Win32 compiler.
2013-07-11 11:00:41 -07:00
Russell Belfer
d70ce9bd7a Clarify docs for git_status_file 2013-07-10 15:38:57 -07:00
Vicent Martí
bd679796a5 Merge pull request #1685 from arrbee/submodule-status-fixes
Improve submodules status data caching and compatibility
2013-07-10 13:15:28 -07:00
Russell Belfer
125655fe3f Untracked directories with .git should be ignored
This restores a behavior that was accidentally lost during some
diff refactoring where an untracked directory that contains a .git
item should be treated as IGNORED, not as UNTRACKED.  The submodule
code already detects this, but the diff code was not handling the
scenario right.

This also updates a number of existing tests that were actually
exercising the behavior but did not have the right expectations in
place.  It actually makes the new
`test_diff_submodules__diff_ignore_options` test feel much better
because the "not-a-submodule" entries are now ignored instead of
showing up as untracked items.

Fixes #1697
2013-07-10 12:15:03 -07:00
Russell Belfer
9564229af4 Add tests for diff.ignoreSubmdules config 2013-07-10 12:15:03 -07:00
Russell Belfer
b8df28a5da Clean up left over alloc change 2013-07-10 12:15:03 -07:00
Russell Belfer
f9775a37aa Add ignore_submodules to diff options
This adds correct support for an equivalent to --ignore-submodules
in diff, where an actual ignore value can be passed to diff to
override the per submodule settings in the configuration.

This required tweaking the constants for ignore values so that
zero would not be used and could represent an unset option to the
diff.  This was an opportunity to move the submodule values into
include/git2/types.h and to rename the poorly named DEFAULT values
for ignore and update constants to RESET instead.

Now the GIT_DIFF_IGNORE_SUBMODULES flag is exactly the same as
setting the ignore_submodules option to GIT_SUBMODULE_IGNORE_ALL
(which is actually a minor change from the old behavior in that
submodules will now be treated as UNMODIFIED deltas instead of
being left out totally - if you set GIT_DIFF_INCLUDE_UNMODIFIED).

This includes tests for the various new settings.
2013-07-10 12:15:03 -07:00