|
4f2d272f
|
2014-11-05T16:51:39
|
|
ignore: don't leak rules into higher directories
A rule "src" in src/.gitignore must only match subdirectories of
src/. The current code does not include this context in the match rule
and would thus consider this rule to match the top-level src/ directory
instead of the intended src/src/.
Keep track fo the context in which the rule was defined so we can
perform a prefix match.
|
|
8fce79b3
|
2014-12-05T18:25:38
|
|
ignore: match git's rule negation rules
A rule can only negate something which was explicitly mentioned in the
rules before it. Change our parsing to ignore a negative rule which does
not negate something mentioned in the rules above it.
While here, fix a wrong allocator usage. The memory for the match string
comes from pool allocator. We must not free it with the general
allocator. We can instead simply forget the string and it will be
cleaned up.
|
|
f888185f
|
2014-12-05T16:31:14
|
|
ignore: adjust test for negating inside a dir
Given
top
!top/foo
in an ignore file, we should not unignore top/foo. This is an
implementation detail of the git code leaking, but that's the behaviour
we should show.
A negation rule can only negate an exact rule it has seen before.
|
|
8de0f1ed
|
2014-12-20T21:28:12
|
|
Merge pull request #2770 from tkelman/patch-1
[maint/v0.21] Fix build of tests with mingw
|
|
b38fe6f5
|
2014-12-20T19:12:46
|
|
Fix build of tests with mingw
very, very partial backport of 2f795d8fc50d81641d95723d9ddd92795886bed3 to maint/v0.21 branch
without this include, O_RDWR and O_CREAT are undeclared when building tests/path/win32.c with mingw
|
|
4058f1cc
|
2014-12-19T08:08:47
|
|
Fix ming32 compilation
We need to know what wchar_t and MAX_PATH are. Including common.h takes
care of that for us.
|
|
04da2363
|
2014-12-19T15:31:49
|
|
Fix public header on sys/refs.h
GIT_BEGIN/END_DECL were missing from sys/refs.h and preventing
compilation with g++ as the symbol were mangled.
|
|
59c8ff08
|
2014-12-20T13:06:24
|
|
Merge tag 'v0.21.3' into maint/v0.21
|
|
e476e7be
|
2014-12-18T12:41:59
|
|
index tests: test capitalization before mkdir
|
|
90fad07d
|
2014-12-18T02:11:06
|
|
Plug leaks
|
|
188ca622
|
2014-12-18T02:07:36
|
|
Create miscapitialised dirs for case-sensitive filesystems
We need these directories to exist so cl_git_mkfile() can create the
files we ask it to.
|
|
88c8abf6
|
2014-12-17T13:39:39
|
|
Bump version to 0.21.3
|
|
2b37e33f
|
2014-12-16T18:53:55
|
|
Introduce core.protectHFS and core.protectNTFS
Validate HFS ignored char ".git" paths when `core.protectHFS` is
specified. Validate NTFS invalid ".git" paths when `core.protectNTFS`
is specified.
|
|
581368ff
|
2014-12-16T13:03:02
|
|
path: Use UTF8 iteration for HFS chars
|
|
43201809
|
2014-12-10T19:12:16
|
|
checkout: disallow bad paths on HFS
HFS filesystems ignore some characters like U+200C. When these
characters are included in a path, they will be ignored for the
purposes of comparison with other paths. Thus, if you have a ".git"
folder, a folder of ".git<U+200C>" will also match. Protect our
".git" folder by ensuring that ".git<U+200C>" and friends do not match it.
|
|
8e7a9578
|
2014-12-02T22:20:42
|
|
reference_create: validate loose names
Validate loose reference names on Win32.
|
|
9686c6bb
|
2014-11-25T18:13:00
|
|
checkout: disallow bad paths on win32
Disallow:
1. paths with trailing dot
2. paths with trailing space
3. paths with trailing colon
4. paths that are 8.3 short names of .git folders ("GIT~1")
5. paths that are reserved path names (COM1, LPT1, etc).
6. paths with reserved DOS characters (colons, asterisks, etc)
These paths would (without \\?\ syntax) be elided to other paths - for
example, ".git." would be written as ".git". As a result, writing these
paths literally (using \\?\ syntax) makes them hard to operate with from
the shell, Windows Explorer or other tools. Disallow these.
|
|
12db885b
|
2014-11-25T00:58:03
|
|
index: Check for valid paths before creating an index entry
|
|
928429c5
|
2014-11-25T00:14:52
|
|
tree: Check for `.git` with case insensitivy
|
|
09361dfe
|
2014-12-01T13:09:58
|
|
win32: use NT-prefixed "\\?\" paths
When turning UTF-8 paths into UCS-2 paths for Windows, always use
the \\?\-prefixed paths. Because this bypasses the system's
path canonicalization, handle the canonicalization functions ourselves.
We must:
1. always use a backslash as a directory separator
2. only use a single backslash between directories
3. not rely on the system to translate "." and ".." in paths
4. remove trailing backslashes, except at the drive root (C:\)
|
|
b5ee184c
|
2014-12-01T13:06:11
|
|
clar: wide character comparisons
|
|
c7e785b7
|
2014-11-26T16:24:37
|
|
tests: use p_ instead of posix func directly
|
|
ce173c9f
|
2014-12-10T17:02:42
|
|
Merge pull request #2733 from akikoskinen/maint/v0.21
Backport two important changes to 0.21 branch
|
|
dc39d232
|
2014-11-15T14:35:58
|
|
Plug possible leak in the openssl locks
|
|
3a2c60e7
|
2014-11-01T10:26:09
|
|
ssl: clear the OpenSSL locking function
We're freeing the memory which holds the locks so we must make sure that
the locking function doesn't try to use it.
|
|
9c046353
|
2014-11-03T13:46:56
|
|
Fix segmentation fault observed on OpenBSD/sparc64
A non-readable mapping of a file causes an access violation in
the pack tests. Always use PROT_READ to work around this.
|
|
4af08d9f
|
2014-10-27T01:18:13
|
|
Bump version to 0.21.2
|
|
a1f4d65a
|
2014-10-27T01:07:26
|
|
Merge pull request #2655 from ethomson/v0.21.2
More backports to 0.21
|
|
cc71348d
|
2014-10-25T19:52:11
|
|
global: clean up openssl_locks on shutdown
|
|
cb93013a
|
2014-10-25T17:17:15
|
|
config test: clean up memory leak
|
|
f4cb227c
|
2014-10-25T15:30:29
|
|
travis ci: build maint branches and development'
|
|
55952873
|
2014-10-24T08:23:14
|
|
Fixed memory leak in git_tag_delete()
|
|
7881bab2
|
2014-10-21T09:29:45
|
|
Patch from @carlosmn to refresh the parent config before snapshotting.
|
|
1ebb8e94
|
2014-10-21T09:29:17
|
|
Change the length of the file so that the change is picked up.
|
|
acbfce9f
|
2014-10-16T13:52:55
|
|
Add a test to make sure a new snapshot has the new value.
|
|
635ba118
|
2014-10-11T11:23:34
|
|
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).
|
|
b2fa95a0
|
2014-10-11T14:34:24
|
|
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.
|
|
01a1be3f
|
2014-10-11T21:38:22
|
|
Don't copy buffer in checkout unless needed
|
|
46ef5a71
|
2014-10-10T13:22:11
|
|
Ensure filters (i.e. CRLF) are applied when checking out conflict content
|
|
6e41c27f
|
2014-10-11T20:56:50
|
|
Introduce failing test for conflict filtering in index
|
|
d055f4ea
|
2014-10-03T19:34:37
|
|
repository_head_unborn: clear error when HEAD is unborn
|
|
5757c020
|
2014-10-18T15:52:10
|
|
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.
|
|
d6b97cbb
|
2014-10-11T14:47:30
|
|
Merge pull request #2596 from libgit2/cmn/maint-21
Add a few backports to 0.21 maintenance
|
|
05713621
|
2014-09-25T15:35:00
|
|
Silence unused return value warning
|
|
c02c5308
|
2014-09-25T15:29:35
|
|
Ensure patch is initialized to zero, otherwise, the allocated flag may be set
|
|
6004658d
|
2014-09-25T15:29:03
|
|
Silence uninitialized warning
|
|
b9334652
|
2014-06-11T16:00:04
|
|
Fixed odb foreach test failure for big-endian 64-bit
|
|
8a89bdae
|
2014-06-11T09:37:15
|
|
Fixed merge REUC test for big-endian 64-bit
|
|
e8b6f55f
|
2014-09-25T13:07:36
|
|
The raw index buffer content is not guaranteed to be aligned
* Ensure alignment by copying the content into a structure on the stack
|
|
55f72c19
|
2014-09-25T12:05:48
|
|
Ensure pool data is aligned on an 8 byte boundary
|
|
f975fe90
|
2014-09-25T12:05:26
|
|
Introduce GIT_ALIGN
|
|
2f83bfce
|
2014-10-09T11:44:05
|
|
git_filter: dup the filter name
|
|
68fce7f0
|
2014-10-04T23:27:06
|
|
config: Fix multiple trailing spaces before comments not completely trimmed
|
|
a97157af
|
2014-09-05T22:31:53
|
|
When auto follow tags, FETCH_HEAD should list only newly followed tags
|
|
e0235452
|
2014-09-10T18:28:19
|
|
global: free the error message when exiting a thread
When we free the global state at thread termination, we must also free
the error message in order not to leak the string once per thread.
|
|
b5935779
|
2014-09-24T12:01:14
|
|
Correctly handle getaddrinfo return result
The getaddrinfo function indicates failure with a non-zero return code,
but this code is not necessarily negative. On platforms like Android
where the code is positive, a failed call causes libgit2 to segfault.
|
|
ba5cef03
|
2014-09-24T13:24:39
|
|
Recurse ignored directories when stashing
|
|
80ddaec7
|
2014-09-30T16:27:53
|
|
Include git2/odb_backend.h in git2.h
Since this isn't under sys/ we need to have it included in the main
git2.h file.
This fixes #2551.
|
|
59fbaa4b
|
2014-09-24T11:20:43
|
|
cherrypick: the name is still git_cherry_pick
A backported fix makes use of the new name for git_cherry_pick (namely
git_cherrypick), but we still need to use the old one in the maint
branch.
|
|
c12bc323
|
2014-09-12T22:37:15
|
|
Remove local unused index_repo variable
|
|
9a8126e0
|
2014-09-12T22:53:56
|
|
Only check for workdir conflicts if the index has merged files
Passing 0 as the length of the paths to check to git_diff_index_to_workdir
results in all files being treated as conflicting, that is, all untracked or
modified files in the worktree is reported as conflicting
|
|
edb2b835
|
2014-09-12T21:59:09
|
|
Added test case to illustrate bogus conflicts detected if no files were merged, and untracked files exist in the workdir.
|
|
c93d1eba
|
2014-09-04T16:46:14
|
|
ssh: store error message immediately after a failed agent call
When the call to the agent fails, we must retrieve the error message
just after the function call, as other calls may overwrite it.
As the agent authentication is the only one which has a teardown and
there does not seem to be a way to get the error message from a stored
error number, this tries to introduce some small changes to store the
error from the agent.
Clearing the error at the beginning of the loop lets us know whether the
agent has already set the libgit2 error message and we should skip it,
or if we should set it.
|
|
ebee4d55
|
2014-08-26T15:09:47
|
|
pack: return the correct final offset
The callers of git_packfile_unpack() expect the obj_offset argument to
be set to the beginning of the next object. We were mistakenly returning
the the offset of the object's data, which causes the CRC function to
try to use the wrong offset.
Set obj_offset to curpos instead of elem->offset to point to the next
element and bring back expected behaviour.
|
|
b401dc9e
|
2014-08-15T22:51:19
|
|
git_remote_ls() should return an error if the transport is not available
|
|
7d729d0b
|
2014-08-16T22:12:13
|
|
http: make sure we can consume the data we request
The recv buffer (parse_buffer) and the buffer have independent sizes and
offsets. We try to fill in parse_buffer as much as possible before
passing it to the http parser. This is fine most of the time, but fails
us when the buffer is almost full.
In those situations, parse_buffer can have more data than we would be
able to put into the buffer (which may be getting full if we're towards
the end of a data sideband packet).
To work around this, we check if the space we have left on our buffer is
smaller than what could come from the network. If this happens, we make
parse_buffer think that it has as much space left as our buffer, so it
won't try to retrieve more data than we can deal with.
As the start of the data may no longer be at the start of the buffer, we
need to keep track of where it really starts (data_offset) and use that
in our calculations for the real size of the data we received from the
network.
This fixes #2518.
|
|
ea971905
|
2014-08-09T10:56:50
|
|
config: a multiline var can start immediately
In the check for multiline, we traverse the backslashes from the end
backwards and int the end assert that we haven't gone past the beginning
of the line. We make sure of this in the loop condition, but we also
check in the return value.
However, for certain configurations, a line in a multiline variable
might be empty to aid formatting. In that case, 'end' == 'start', since
we ended up looking at the first char which made it a multiline.
There is no need for the (end > start) check in the return, since the
loop guarantees we won't go further back than the first char in the
line, and we do accept the first char to be the final backslash.
This fixes #2483.
|
|
b4d00c1d
|
2014-07-25T08:25:41
|
|
array: mark the array to grow as volatile
This works around strict aliasing rules letting some versions of
GCC (particularly on RHEL 6) thinking that they can skip updating the
size of the array when calculating the next element's offset.
|
|
f3f9dc07
|
2014-07-24T16:46:59
|
|
revwalk: remove preallocation of the uninteresting commits
Preallocating two commits doesn't make much sense as leaving allocation
to the first array usage will allocate a sensible size with room for
growth.
This preallocation has also been hiding issues with strict aliasing in
the tests, as we have fairly simple histories and never trigger the
growth.
|
|
440a87a1
|
2014-07-16T21:54:53
|
|
Add unit test to test add section without lf at EOF
|
|
190fe072
|
2014-07-16T21:09:53
|
|
Make sure \n is at the end of config file before a new section is written
|
|
ace65671
|
2014-07-09T14:12:30
|
|
Properly report failure when expanding a packfile
|
|
f8b4093a
|
2014-07-04T17:17:23
|
|
refspec: support asterisks in the middle of a pattern
We used to assume a refspec would only have an asterisk in the middle of
their respective pattern. This has not been a valid assumption for some
time now with git.
Instead of assuming where the asterisk is going to be, change the logic
to treat each pattern as having two halves with a replacement bit in the
middle, where the asterisk is.
|
|
0aa6b7e6
|
2014-07-04T17:16:17
|
|
refspec: short-circuit non-pattern refspecs on transform
When transforming a non-pattern refspec, we simply need to copy over the
opposite string. Move that logic up to the wrapper so we can assume a
pattern refspec in the transformation function.
|
|
18cf389c
|
2014-07-03T20:20:00
|
|
Include libssh2.h before git2.h (transport.h)
|
|
dbcb7518
|
2014-07-03T20:19:16
|
|
Fix git_cred_ssh_interactive_callback signature
|
|
0e594633
|
2014-07-03T02:34:32
|
|
netops: error out on url without a path
In order to connect to a remote server, we need to provide a path to the
repository we're interested in. Consider the lack of path in the url an
error.
|
|
12dcc6ee
|
2014-07-02T12:49:51
|
|
ssh: libssh2_channel_write() behaves like send()
When the stream writing function was written, it assume that
libssh2_channel_write() would always write all of the data to the
wire. This is only true for the first 32k of data, which it tries to
fit into one ssh packet.
Since it can perform short writes, call it in a loop like we do for
send(), advancing the buffer offset.
|
|
38ddf227
|
2014-06-30T12:05:25
|
|
Round up pool alloc sizes for alignment
To make sure that items returned from pool allocations are aligned
on nice boundaries, this rounds up all pool allocation sizes to a
multiple of 8. This adds a small amount of overhead to each item.
The rounding up could be made optional with an extra parameter to
the pool initialization that turned on rounding only for pools
where item alignment actually matters, but I think for the extra
code and complexity that would be involved, that it makes sense
just to burn a little bit of extra memory and enable this all the
time.
|
|
63ee946d
|
2014-06-30T23:18:37
|
|
ssh: always declare the libssh2 types
This lets a user decide they do want to use keyboard-interactive after
they've compiled.
|
|
aa1b62ba
|
2014-06-30T10:03:36
|
|
ssh: create the right callback signature based on build options
When linking against libssh2, create the transport.h such that it
contains its definition for custom crypto and keyboard-interactive
callbacks.
If we don't link against libssh2, create an equivalent signature which
has void pointers instead of pointers to libssh2 structures.
This would be one way to fix #2438.
|
|
1d430056
|
2014-06-30T09:19:05
|
|
ssl: init only once without threads
The OpenSSL library-loading functions do not expect to be called
multiple times. Add a flag in the non-threaded libgit2 init so we only
call once.
This fixes #2446.
|
|
58383387
|
2014-08-01T15:21:13
|
|
Merge pull request #2494 from libgit2/cmn/treebuilder-set-attribute
treebuilder: set the attributes before sorting and inserting
|
|
b6925681
|
2014-07-31T21:16:40
|
|
treebuilder: set the attributes before sorting and inserting
We need to set the attributes before we try to insert it into the
vector, as the comparison function needs to know whether the entry is a
tree or not.
|
|
28f087c8
|
2014-06-20T14:42:16
|
|
libgit2 v0.21.0
|
|
1589aa0c
|
2014-06-16T11:11:40
|
|
Merge pull request #2425 from libgit2/cmn/clone-auth-change
Don't use read-write accounts for the tests
|
|
e93206e0
|
2014-06-14T12:58:03
|
|
Merge pull request #2421 from libgit2/cmn/init-ssl-once
netops: init OpenSSL once under lock
|
|
09561d33
|
2014-06-13T22:27:46
|
|
test: remove assembla clone test
The assembla failure we were seeing referred to a private repository,
which is not what is there at the moment.
This reverts 1fd21b0342f
|
|
3382d8b1
|
2014-06-13T22:24:43
|
|
test: use read-only account
Don't write in plaintext the password of an account which has full
control over the repository. Instead use an account with read-only
access.
|
|
9c3e4e97
|
2014-06-13T02:35:33
|
|
http: fix typo in credentials logic
We want to check whether the credentials callback is NULL, not whether
the payload is.
|
|
081e76ba
|
2014-06-12T16:20:52
|
|
ssl: init everything all the time
Bring together all of the OpenSSL initialization to
git_threads_init() so it's together and doesn't need locks.
Moving it here also gives us libssh2 thread safety (when built against
openssl).
|
|
8f897b6f
|
2014-06-12T14:50:08
|
|
ssl: init also without threads
|
|
cf15ac8a
|
2014-06-12T03:20:34
|
|
ssl: cargo-cult thread safety
OpenSSL's tests init everything in the main thread, so let's do that.
|
|
5fa04943
|
2014-06-11T23:19:48
|
|
ssl: use locking
When using in a multithreaded context, OpenSSL needs to lock, and leaves
it up to application to provide said locks.
We were not doing this, and it's just luck that's kept us from crashing
up to now.
|
|
76f76162
|
2014-06-11T21:14:45
|
|
remote: update documentation
Add docs for git_clone_local_t and move the docs for the
git_clone_options to each field.
|
|
1d3364ac
|
2014-06-11T20:52:15
|
|
netops: init OpenSSL once under lock
The OpenSSL init functions are not reentrant, which means that running
multiple fetches in parallel can cause us to crash.
Use a mutex to init OpenSSL, and since we're adding this extra checks,
init it only once.
|
|
3f3d21ba
|
2014-06-11T18:56:24
|
|
Merge pull request #2417 from libgit2/cmn/revwalk-array-fix
revwalk: more sensible array handling
|
|
f9a97667
|
2014-06-11T00:06:44
|
|
revwalk: more sensible array handling
Instead of using a sentinel empty value to detect the last commit, let's
check for when we get a NULL from popping the stack, which lets us know
when we're done.
The current code causes us to read uninitialized data, although only on
RHEL/CentOS 6 in release mode. This is a readability win overall.
|
|
7064cdaf
|
2014-06-10T12:56:11
|
|
Merge pull request #2416 from libgit2/cmn/treebuilder-insert-sorted
treebuilder: insert sorted
|
|
17fbf852
|
2014-06-10T03:53:26
|
|
pathspec: use C guards in header
|