Commit Graph

7336 Commits

Author SHA1 Message Date
Edward Thomson
cdd71711ce Clean up some memory leaks 2014-10-26 22:27:44 -04:00
Edward Thomson
369b021733 Clean up various compiler warnings 2014-10-26 22:13:40 -04:00
Carlos Martín Nieto
70f7e2c6e3 Merge from 2660 2014-10-27 01:48:37 +01:00
Carlos Martín Nieto
fad0aea9fe tests: fix leak 2014-10-27 01:47:40 +01:00
Linquize
9223f2884c Fix test repo dir not deleted after running 2014-10-27 01:06:28 +08:00
Edward Thomson
d09458f3e9 Merge pull request #2638 from libgit2/cmn/config-refresh-remove
config: remove the refresh function and backend field
2014-10-24 16:52:39 -07:00
Edward Thomson
725cd5f29d Merge pull request #2646 from libgit2/cmn/remote-rename
remote: accept a repo and name for renaming
2014-10-24 16:44:07 -07:00
Edward Thomson
b8041215cf Merge pull request #2649 from swisspol/2630
Fixed memory leak in git_tag_delete()
2014-10-24 14:02:53 -07:00
Edward Thomson
a747ea49c9 Merge pull request #2647 from ethomson/clar_tmpname
clar: use a custom temp directory name
2014-10-24 14:01:13 -07:00
Edward Thomson
cdfd2b62b7 Merge pull request #2645 from libgit2/cmn/common-crypto
[RFC] Use CommonCrypto for hashing
2014-10-24 08:27:38 -07:00
Pierre-Olivier Latour
1ad15540e4 Fixed memory leak in git_tag_delete() 2014-10-24 08:23:14 -07:00
Edward Thomson
29eed1c74d clar: use a custom temp directory name 2014-10-24 10:50:57 -04:00
Edward Thomson
27372263a0 Merge pull request #2644 from libgit2/cmn/remove-supported-url
remote: delete git_remote_supported_url()
2014-10-24 07:39:10 -07:00
Carlos Martín Nieto
46c8f7f845 remote: accept a repo and name for renaming
Remote objects are not meant to be changed from under the user. We did
this in rename, but only the name and left the refspecs, such that a
save would save the wrong refspecs (and a fetch and anything else would
use the wrong refspecs).

Instead, let's simply take a name and not change any loaded remote from
under the user.
2014-10-24 16:25:59 +02:00
Carlos Martín Nieto
0862f617da remote: delete git_remote_supported_url()
This function does not in fact tell us anything, as almost anything with
a colon in it is a valid rsync-style SSH path; it can not tell us that
we do not support ftp or afp or similar as those are still valid SSH
paths and we do support that.
2014-10-24 13:40:42 +02:00
Carlos Martín Nieto
d9c0dbb042 hash: use CommonCrypto on OSX for SHA-1
OSX has its own cryptographic library, let's make use of it instead of
calling out to OpenSSL.
2014-10-24 13:31:18 +02:00
Carlos Martín Nieto
55cb499972 config: remove the refresh function and backend field
We have been refreshing on read and write for a while now, so
git_config_refresh() is at best a no-op, and might just end up wasting
cycles.
2014-10-23 19:05:02 +02:00
Carlos Martín Nieto
4bb6ffb6bb Merge pull request #2622 from libgit2/refresh-config-snapshot
Refresh git configuration before looking for the tracking branch redux.
2014-10-23 18:58:39 +02:00
Edward Thomson
d676af43da Merge pull request #2625 from libgit2/cmn/ssl-tls
ssl: dump the SSL ciphers in favour of TLS
2014-10-23 08:27:13 -07:00
Carlos Martín Nieto
f0f9737094 ssl: dump the SSL ciphers in favour of TLS
All versions of SSL are considered deprecated now, so let's ask OpenSSl
to only use TLSv1. We still ask it to load those ciphers for
compatibility with servers which want to use an older hello but will use
TLS for encryption.

For good measure we also disable compression, which can be exploitable,
if the OpenSSL version supports it.
2014-10-23 15:56:29 +02:00
Alan Rogers
ad5adacb1d Patch from @carlosmn to refresh the parent config before snapshotting. 2014-10-23 15:21:30 +11:00
Alan Rogers
1e2fe921a5 Change the length of the file so that the change is picked up. 2014-10-23 15:21:29 +11:00
Alan Rogers
5490c9d470 Add a test to make sure a new snapshot has the new value. 2014-10-23 15:21:04 +11:00
Edward Thomson
943fde7f8c Merge pull request #2617 from linquize/describe-example
describe: add example
2014-10-22 20:48:04 -07:00
Edward Thomson
196f3b1a9f Merge pull request #2619 from ethomson/remotes_with_unc
Remote paths: canonicalize UNC paths on Win32
2014-10-22 20:38:59 -07:00
Edward Thomson
12f32d9193 Remote paths: canonicalize UNC paths on Win32
Git for Windows will handle UNC paths only when in forward-slash
format, eg "//server/path".  When given a UNC path as a remote,
rewrite standard format ("\\server\path") into this ridiculous
format.
2014-10-22 17:49:53 -04:00
Edward Thomson
89244e7ff9 Merge pull request #2634 from libgit2/cmn/tree-cache-count
tree-cache: correct the entry_count calculation
2014-10-22 14:45:36 -07:00
Carlos Martín Nieto
bb0757d56c tree-cache: correct the entry_count calculation
The entry_count field is the amount of index entries covered by a
particular cache entry, that is how many files are there (recursively)
under a particular directory.

The current code that attemps to do this is severely defincient and is
trying to count the amount of children, which always comes up to zero.

We don't even need to recount, since we have the information during the
cache creation. We can take that number and keep it, as we only ever
invalidate or replace.
2014-10-22 21:25:08 +02:00
Carlos Martín Nieto
12e1803188 Update some documentation 2014-10-18 15:22:19 +02:00
Carlos Martín Nieto
c51aa74ed3 PROJECTS: remove two completed tasks 2014-10-17 22:09:54 +02:00
Edward Thomson
e0383fa35f Merge pull request #2609 from linquize/describe-opts
Handle describe options better
2014-10-13 16:59:56 -04:00
Edward Thomson
c6e2621052 Merge pull request #2615 from ethomson/mount_points
Mount points
2014-10-13 16:52:44 -04:00
Edward Thomson
c0c8570c51 Merge pull request #2616 from ethomson/index_crlf
Apply filters when writing index
2014-10-13 16:51:40 -04:00
Edward Thomson
6a26488f8b Don't copy buffer in checkout unless needed 2014-10-13 13:36:20 -04:00
Jacques Germishuys
5e2cf2ca2c Ensure filters (i.e. CRLF) are applied when checking out conflict content 2014-10-13 13:36:18 -04:00
Edward Thomson
8d3b2ee3d7 Introduce failing test for conflict filtering in index 2014-10-13 13:36:16 -04:00
Edward Thomson
24deacb7ee Merge pull request #2618 from csware/msvc-no-z-prefix
There is no "z" size specifier on MSVC
2014-10-13 11:01:52 -04:00
Edward Thomson
969b6a4710 is_empty_dir (wi32): cope with empty mount points
FindFirstFile will fail with INVALID_HANDLE_VALUE if there are no
children to the given path, which can happen if the given path is a
file (and obviously has no children) or if the given path is an empty
mount point.  (Most directories have at least directory entries '.'
and '..', but ridiculously another volume mounted in another drive
letter's path space do not, and thus have nothing to enumerate.)

If FindFirstFile fails, check if this is a directory-like thing
(a mount point).
2014-10-13 10:58:05 -04:00
Edward Thomson
8d45b4691c p_lstat win32: don't canonicalize volume mounts
A reparse point that is an IO_REPARSE_TAG_MOUNT_POINT could be
a junction or an actual filesystem mount point.  (Who knew?)
If it's the latter, its reparse point will report the actual
volume information \??\Volume{GUID}\ and we should not attempt
to dereference that further, instead readlink should report
EINVAL since it's not a symlink / junction and its original
path was canonical.

Yes, really.
2014-10-13 10:58:03 -04:00
Sven Strickroth
cf1013a888 There is no "z" size specifier on MSVC
See http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx and https://stackoverflow.com/questions/6655410/why-doesnt-zd-printf-format-work-in-vs2010

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2014-10-13 16:32:26 +02:00
Linquize
d6bbcefce3 describe: add example 2014-10-12 19:25:20 +08:00
Edward Thomson
9e49cb7a4b Merge pull request #2613 from libgit2/rb/minor-cleanups
Minor cleanups for master
2014-10-11 14:48:57 -04:00
Linquize
59186d9b15 describe: Initialize options for git_describe_format() if null 2014-10-11 07:52:47 +08:00
Linquize
0494a7c9a9 describe: Do not crash if pass null option to git_describe_commit() 2014-10-11 07:52:47 +08:00
Russell Belfer
85fe63bc58 Don't use cl_git_pass for POSIX functions
If there is a failure then cl_git_pass tries to get the libgit2
error, but p_... functions don't set that.

Also - trailing whitespace cleanup.
2014-10-10 15:17:27 -07:00
Russell Belfer
babbff347c Move un-namespaced constant to internal header
FLAG_BITS only seems to be used internally
2014-10-10 15:17:05 -07:00
Edward Thomson
fd0f6d3855 Merge pull request #2470 from libgit2/cmn/read-tree-cache
Fill the tree cache when reading in a tree into an index
2014-10-10 14:06:14 -04:00
Carlos Martín Nieto
1b63af5133 Update CHANGELOG and PROJECTS with the tree cache changes 2014-10-10 19:43:42 +02:00
Carlos Martín Nieto
7465e87399 index: fill the tree cache on write-tree
An obvious place to fill the tree cache is on write-tree, as we're
guaranteed to be able to fill in the whole tree cache.

The way this commit does this is not the most efficient, as we read the
root tree from the odb instead of filling in the cache as we go along,
but it fills the cache such that successive operations (and persisting
the index to disk) will be able to take advantage of the cache, and it
reuses the code we already have for filling the cache.

Filling in the cache as we create the trees would require some
reallocation of the children vector, which is currently not possible
with out pool implementation. A different data structure would likely
allow us to perform this operation at a later date.
2014-10-10 19:43:42 +02:00
Carlos Martín Nieto
795d8e9328 index: make sure to write cached subtrees if parent is invalidated
If e.g. the root tree is invalidated, we still want to write out
its children, since those may still have valid cache entries.
2014-10-10 19:43:42 +02:00