Commit Graph

8778 Commits

Author SHA1 Message Date
Axel Rasmussen
973a09a4ca index: don't populate nsec values if GIT_USE_NSEC is off 2015-10-01 18:35:21 -07:00
Axel Rasmussen
c7b17fb5cd Merge branch 'master' into nsec_fix_next 2015-10-01 18:01:32 -07:00
Carlos Martín Nieto
a99f33e9b0 Merge pull request #3447 from arthurschreiber/arthur/fix-odb-refdb-free
refdb and odb backends must provide `free` function
2015-10-01 07:56:19 +02:00
Arthur Schreiber
d3b29fb94b refdb and odb backends must provide free function
As refdb and odb backends can be allocated by client code, libgit2
can’t know whether an alternative memory allocator was used, and thus
should not try to call `git__free` on those objects.

Instead, odb and refdb backend implementations must always provide
their own `free` functions to ensure memory gets freed correctly.
2015-10-01 00:50:37 +02:00
Carlos Martín Nieto
ba1a5553e4 Merge pull request #3446 from ethomson/portability
portability: use `CHECK_FUNCTION_EXISTS` for checking whether functions exist...
2015-09-30 17:44:10 +02:00
Edward Thomson
e8ccdd6bdf Merge pull request #3445 from libgit2/cmn/ssl-null
openssl: don't try to teardown an unconnected SSL context
2015-09-30 06:29:01 -07:00
Edward Thomson
e683d15247 qsort_r/qsort_s: detect their support 2015-09-30 05:49:04 -04:00
Edward Thomson
8649dfd8df p_futimes: support using futimens when available 2015-09-30 05:37:20 -04:00
Carlos Martín Nieto
146a96de82 openssl: don't try to teardown an unconnected SSL context
SSL_shutdown() does not like it when we pass an unitialized ssl context
to it. This means that when we fail to connect to a host, we hide the
error message saying so with OpenSSL's indecipherable error message.
2015-09-30 09:41:25 +02:00
Carlos Martín Nieto
72b7c57093 Merge pull request #3411 from spraints/custom-push-headers
Include custom HTTP headers
2015-09-30 09:17:18 +02:00
Carlos Martín Nieto
c628ebca63 Merge pull request #3443 from libgit2/longpath-printf
win32::longpath: don't print path
2015-09-29 21:46:00 +02:00
Edward Thomson
ea467e7487 win32::longpath: don't print path 2015-09-28 16:46:09 -04:00
Edward Thomson
fc3ef147ec Merge pull request #3441 from libgit2/cmn/badssl
net: add tests against badssl.com
2015-09-28 06:41:00 -07:00
Carlos Martín Nieto
5c5df666b0 Plug some leaks 2015-09-27 23:32:20 +02:00
Carlos Martín Nieto
53a2870514 net: add tests against badssl.com
These provide bad X.509 certificates, which we should refuse to connect
to by default.
2015-09-27 22:56:25 +02:00
Edward Thomson
a8d0b4de92 Merge pull request #3439 from bisho/master
Fix binary diffs
2015-09-25 17:55:31 -04:00
Guille -bisho-
e4b2b919bb Fix binary diffs
git expects an empty line after the binary data:

literal X
...binary data...
<empty_line>

The last literal block of the generated patches were not containing the required empty line. Example:

	diff --git a/binary_file b/binary_file
	index 3f1b3f9098131cfecea4a50ff8afab349ea66d22..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644
	GIT binary patch
	literal 8
	Pc${NM&PdElPvrst3ey5{

	literal 6
	Nc${NM%g@i}0ssZ|0lokL
	diff --git a/binary_file2 b/binary_file2
	index 31be99be19470da4af5b28b21e27896a2f2f9ee2..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644
	GIT binary patch
	literal 8
	Pc${NM&PdElPvrst3ey5{

	literal 13
	Sc${NMEKbZyOexL+Qd|HZV+4u-

git apply of that diff results in:

	error: corrupt binary patch at line 9: diff --git a/binary_file2 b/binary_file2
	fatal: patch with only garbage at line 10

The proper formating is:

	diff --git a/binary_file b/binary_file
	index 3f1b3f9098131cfecea4a50ff8afab349ea66d22..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644
	GIT binary patch
	literal 8
	Pc${NM&PdElPvrst3ey5{

	literal 6
	Nc${NM%g@i}0ssZ|0lokL
	diff --git a/binary_file2 b/binary_file2
	index 31be99be19470da4af5b28b21e27896a2f2f9ee2..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644
	GIT binary patch
	literal 8
	Pc${NM&PdElPvrst3ey5{

	literal 13
	Sc${NMEKbZyOexL+Qd|HZV+4u-
2015-09-25 10:37:41 -07:00
Matt Burke
d7375662e7 Copy custom_headers insteach of referencing the caller's copy 2015-09-25 10:16:30 -04:00
Matt Burke
d16c1b978f These can be static 2015-09-24 10:32:29 -04:00
Matt Burke
e60db3c79a Revise custom header error messages
If the header doesn't look like a header (e.g. if it doesn't have a ":"
or if it has newlines), report "custom HTTP header '%s' is malformed".

If the header has the same name as a header already set by libgit2 (e.g.
"Host"), report "HTTP header '%s' is already set by libgit2".
2015-09-24 09:24:10 -04:00
Matt Burke
63cc57232c Don't null-check 2015-09-24 09:13:05 -04:00
Matt Burke
098f1e6e25 Use an array of forbidden custom headers 2015-09-24 09:09:48 -04:00
Carlos Martín Nieto
588e28ebfd Merge pull request #3437 from libgit2/cmn/plug-sm
submodule: plug a few leaks
2015-09-24 13:20:48 +02:00
Carlos Martín Nieto
ab8f2c669a submodule: plug a few leaks 2015-09-24 11:37:31 +02:00
Carlos Martín Nieto
27187344bb Merge pull request #3435 from ethomson/nametoolong
win32: give better error message on long paths
2015-09-23 15:16:01 +02:00
Edward Thomson
9768ebb1f3 win32: test checkout msg on long path err 2015-09-23 08:27:24 -04:00
Edward Thomson
92a47824d8 win32: propogate filename too long errors 2015-09-22 23:10:56 -04:00
Carlos Martín Nieto
aebddbe736 Merge pull request #3434 from ethomson/reservednames
Win32 Reserved names: don't reserve names outside the working directory
2015-09-21 06:01:03 +02:00
Axel Rasmussen
28cdb3153c apple: work around non-POSIX struct stat on OS X. 2015-09-18 23:56:19 -07:00
Axel Rasmussen
0226f7dd36 diff/index: respect USE_NSEC for racily clean file detection 2015-09-18 23:33:56 -07:00
Axel Rasmussen
360dd4dafd win32: define our own POSIX struct stat, and support USE_NSEC 2015-09-18 23:33:56 -07:00
Axel Rasmussen
c963fe1d3d cmake: fix CMake code organization problem 2015-09-18 23:33:56 -07:00
Axel Rasmussen
e9e6df2c8f cmake: Only provide USE_NSEC if struct stat members are avilable.
This allows us to remove OS checks from source code, instead relying
on CMake to detect whether or not `struct stat` has the nanoseconds
members we rely on.
2015-09-18 23:33:56 -07:00
Axel Rasmussen
2be7855727 caps: add test for GIT_FEATURES_NSEC 2015-09-18 23:33:56 -07:00
Axel Rasmussen
0269833f92 settings: expose GIT_USE_NSEC flag in git_libgit2_features 2015-09-18 23:33:56 -07:00
Axel Rasmussen
e7de893ef8 cmake: add USE_NSEC, and only check nanosec m/ctime if enabled 2015-09-18 23:33:55 -07:00
Edward Thomson
cdef1fad36 Merge pull request #3433 from libgit2/cmn/config-comment
Keep config comments in the same place as git
2015-09-18 16:46:57 -04:00
Edward Thomson
538dfc8816 repository: only reserve repo dirs in the workdir
Check that the repository directory is beneath the workdir before
adding it to the list of reserved paths.  If it is not, then there
is no possibility of checking out files into it, and it should not
be a reserved word.

This is a particular problem with submodules where the repo directory
may be in the super's .git directory.
2015-09-18 12:17:57 -04:00
Edward Thomson
e8ddd8d76c repo::reservedname: test a submodule update
Test an initial submodule update, where we are trying to checkout
the submodule for the first time, and placing a file within the
submodule working directory with the same name as the submodule
(and consequently, the same name as the repository itself).
2015-09-18 12:17:49 -04:00
Carlos Martín Nieto
cd677b8fe0 config: buffer comments to match git's variable-adding
When there is a comment at the end of a section, git keeps it there,
while we write the new variable right at the end.

Keep comments buffered and dump them when we're going to output a
variable or section, or reach EOF. This puts us in line with the config
files which git produces.
2015-09-18 12:28:05 +02:00
Linquize
08313c4b12 config: test that comments are left as with git 2015-09-18 12:09:33 +02:00
Carlos Martín Nieto
dfe2856d0f Fix a couple of warnings 2015-09-18 12:06:55 +02:00
Carlos Martín Nieto
403e18004c Merge pull request #3418 from DimStar77/master
pkg-config: fix directory references in libgit2.pc
2015-09-18 12:03:43 +02:00
Dominique Leuenberger
5540d9db20 pkg-config: fix directory references in libgit2.pc
Before:
libdir=/usr//usr/lib64
includedir=/usr//usr/include

After:
libdir=/usr/lib64
includedir=/usr/include

(note the duplication of /usr in the before case)
2015-09-18 11:05:57 +02:00
Carlos Martín Nieto
8d6052df46 Merge pull request #3432 from ethomson/mkdir
`mkdir`: split into `mkdir` and `mkdir_relative`
2015-09-17 22:03:26 +02:00
Edward Thomson
9ce2e7b317 mkdir: cope with root path on win32 2015-09-17 12:48:37 -04:00
Edward Thomson
e164ddb11d win32: return EACCES in p_lstat
Don't coalesce all errors into ENOENT.  At least identify EACCES.
All callers should be handling this case already, as the POSIX
`lstat` will return this.
2015-09-17 12:23:19 -04:00
Edward Thomson
81aaf3704a mkdir: chmod existing paths with GIT_MKDIR_CHMOD 2015-09-17 11:26:38 -04:00
Edward Thomson
e24c60dba4 mkdir: find component paths for mkdir_relative
`git_futils_mkdir` does not blindly call `git_futils_mkdir_relative`.

`git_futils_mkdir_relative` is used when you have some base directory
and want to create some path inside of it, potentially removing blocking
symlinks and files in the process.  This is not suitable for a general
recursive mkdir within the filesystem.

Instead, when `mkdir` is being recursive, locate the first existent
parent directory and use that as the base for `mkdir_relative`.
2015-09-17 10:11:56 -04:00
Edward Thomson
0862ec2eb9 core::mkdir tests: ensure we don't stomp symlinks in mkdir
In `mkdir` and `mkdir_r`, ensure that we don't try to remove symlinks
that are in our way.
2015-09-17 10:11:38 -04:00