Michael Procter
c2f17bda07
Ensure static oom error message not detached
...
Error messages that are detached are assumed to be dynamically
allocated. Passing a pointer to the static oom error message
can cause an attempt to free the static buffer later. This change
checks if the oom error message is about to be detached and detaches
a copy instead.
2015-08-03 15:23:17 +01:00
Michael Procter
5ef4b86015
Add failing test for capture/restore oom error
2015-08-03 15:23:17 +01:00
Edward Thomson
69adb781e1
Merge pull request #3325 from libgit2/cmn/filebuf-rename-error
...
filebuf: remove lockfile upon rename errors
2015-08-03 08:33:53 -05:00
Edward Thomson
0dd8daeada
Merge pull request #3344 from libgit2/cmn/add-unreg-submodule
...
index: stage an unregistered submodule as well
2015-08-03 08:17:47 -05:00
Carlos Martín Nieto
3cf4eb0922
Merge pull request #3348 from MrHacky/remote-path-with-tilde
...
Handle ssh:// and git:// urls containing a '~' character.
2015-08-03 10:29:17 +02:00
Simon
ac728c2483
Handle ssh:// and git:// urls containing a '~' character.
...
For such a path '/~/...' the leading '/' is stripped so the server will
get a path starting with '~' and correctly handle it.
2015-08-03 07:38:07 +01:00
Carlos Martín Nieto
ea961abf24
index: stage an unregistered submodule as well
...
We previously added logic to `_add_bypath()` to update a submodule. Go
further and stage the submodule even if it's not registered to behave
like git.
2015-08-01 20:01:11 +02:00
Carlos Martín Nieto
b426ac90a9
index: test that an unregistered submodule gets staged
...
When we pass the path of a repository to `_bypath()`, we should behave
like git and stage it as a `_COMMIT` regardless of whether it is
registered a a submodule.
2015-08-01 19:52:25 +02:00
Linquize
63e5b55122
index: add test for adding an old-style submodule to index
2015-08-01 19:35:59 +02:00
Carlos Martín Nieto
c400bac4db
Merge pull request #3332 from phatblat/ben/doc-warnings
...
Resolve documentation warnings
2015-08-01 15:38:04 +02:00
Edward Thomson
723babd712
Merge pull request #3341 from stewid/pedantic-compiler-warning
...
Remove extra semicolon outside of a function
2015-07-31 15:36:22 -05:00
Stefan Widgren
c369b37919
Remove extra semicolon outside of a function
...
Without this change, compiling with gcc and pedantic generates warning:
ISO C does not allow extra ‘;’ outside of a function.
2015-07-31 16:23:11 +02:00
Edward Thomson
9d4b7d2524
Merge pull request #3328 from libgit2/cmn/iterator-skip-diriter
...
iterator: skip over errors in diriter init
2015-07-29 16:46:47 -05:00
Edward Thomson
a8058ffda7
Merge pull request #3339 from palmin/palmin-issue-3338
...
case-insensitive check for WWW-Authenticate header
2015-07-29 16:35:08 -05:00
Anders Borum
31a76374a9
case-insensitive check for WWW-Authenticate header
...
Fixes issue #3338
2015-07-29 22:23:00 +02:00
Ben Chatelain
6d8f3a5162
Better param docs
2015-07-28 08:28:33 -06:00
Ben Chatelain
08afd227df
Fix remaining documentation warnings
2015-07-27 18:32:55 -06:00
Ben Chatelain
2da64edb80
Add -Wdocumentation flag if supported
2015-07-27 18:28:29 -06:00
Ben Chatelain
f90fbb8d22
Use correct Doxygen trailing comment syntax
2015-07-27 17:42:08 -06:00
Ben Chatelain
41808d0470
Fix @param names in doc comments
2015-07-27 14:46:50 -06:00
Carlos Martín Nieto
0e391d8526
iterator: adjust unreadable-dir test to new behaviour
...
We don't want the iterator to make us stop whenever we hit an unreadable
dir. We should instead move over to the next item.
2015-07-27 13:31:06 +02:00
Carlos Martín Nieto
12786e0f7c
iterator: skip over errors in diriter init
...
An error here will typically mean that the directory was removed between
the time we iterated the parent and the time we wanted to visit it in
which case we should ignore it.
Other kinds of errors such as permissions (or transient errors) also
better dealt with by pretending we didn't see it.
2015-07-26 17:19:22 +02:00
Carlos Martín Nieto
19d9beb7ff
filebuf: remove lockfile upon rename errors
...
When we have an error renaming the lockfile, we need to make sure
that we remove it upon cleanup. For this, we need to keep track of
whether we opened the file and whether the rename succeeded.
If we did create the lockfile but the rename did not succeed, we
remove the lockfile. This won't protect against all errors, but
the most common ones (target file is open) does get handled.
2015-07-24 23:02:11 +02:00
Carlos Martín Nieto
668053befe
filebuf: failing test for leaving the lockfile when failing to rename
...
When we fail to rename, we currently leave the lockfile laying
around. This shows that behaviour.
2015-07-24 22:55:43 +02:00
Edward Thomson
2dfd5eae33
Merge pull request #3307 from libgit2/cmn/submodule-backslash
...
Normalize submodule urls before looking at them
2015-07-24 15:05:16 -05:00
Edward Thomson
759b2230a5
Merge pull request #3303 from libgit2/cmn/index-add-submodule
...
Allow adding a submodule through git_index_add_bypath
2015-07-24 15:04:20 -05:00
Edward Thomson
91dad18143
Merge pull request #3305 from libgit2/cmn/reflog-del-backend
...
refdb: delete a ref's reflog upon deletion
2015-07-24 15:01:04 -05:00
Edward Thomson
14e805a2ce
Merge pull request #3304 from libgit2/cmn/checkout-free-stream
...
filter: make sure to close the stream even on error
2015-07-24 14:59:38 -05:00
Edward Thomson
4e0421fdbd
Merge pull request #3317 from csware/fix-vista
...
Make libgit2 work on Windows Vista again
2015-07-23 10:00:55 -05:00
Josh Abernathy
abbe17ef1f
Merge pull request #3322 from libgit2/fix-init-ordering
...
Increment `git__n_inits` before doing `init_once`.
2015-07-22 16:01:08 -04:00
joshaber
9830fbba05
Merge branch 'master' into fix-init-ordering
2015-07-22 11:33:18 -04:00
joshaber
cf198fdf2a
Increment git__n_inits
before doing init_once
.
...
Fixes #3318 .
2015-07-22 10:51:38 -04:00
Sven Strickroth
318bb763e9
Make libgit2 work on Windows Vista again
...
(fixes issue #3316 )
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2015-07-22 12:52:24 +02:00
Carlos Martín Nieto
42156d5617
Merge pull request #3315 from rcorre/docfix
...
Document git_fetch_options struct and fix typo.
2015-07-20 16:47:21 +02:00
Ryan Roden-Corrent
37996d474b
Document git_fetch_options struct and fix typo.
...
git_fetch_options was missing from the API docs because it lacked a
documentation comment above the struct declaration.
I used the git_checkout_options docstring as a template.
Also fixes a typo in git_remote_prune_refs (remote, not reamote).
2015-07-20 09:48:01 -04:00
Edward Thomson
274f0b9371
Merge pull request #3311 from Fallso/MacroRedefinition
...
Fix macro redefinition warning
2015-07-15 09:17:35 -05:00
Fallso
cec3569f25
Fix macro redefinition warning
2015-07-15 11:40:06 +01:00
Carlos Martín Nieto
ceb5873913
Merge pull request #3302 from libgit2/cmn/submodule-foreach-diff-path
...
List a submodule only once when the path matches a submodule in the index
2015-07-13 18:50:39 +02:00
Carlos Martín Nieto
a58854a031
submodule, path: extract slash conversion
...
Extract the backslash-to-slash conversion into a helper function.
2015-07-13 17:11:19 +02:00
Carlos Martín Nieto
97c0a85fc6
Merge pull request #3306 from libgit2/cmn/fetch-ex-fetch
...
examples: modernise the fetch example
2015-07-13 11:23:07 +02:00
Carlos Martín Nieto
f00f005bad
submodule: normalize slashes in resolve_url
...
Our path functions expect to work with slashes, so convert a
path with backslashes into one with slashes at the top of
the function.
2015-07-13 09:08:32 +02:00
Carlos Martín Nieto
aa51fa1e03
submodule: add failing test for backslash in url
2015-07-13 08:39:35 +02:00
Carlos Martín Nieto
f861abadfe
Merge branch 'portable-zu'
2015-07-12 19:56:19 +02:00
Matthew Plough
768f8be31c
Fix #3094 - improve use of portable size_t/ssize_t format specifiers.
...
The header src/cc-compat.h defines portable format specifiers PRIuZ, PRIdZ, and PRIxZ. The original report highlighted the need to use these specifiers in examples/network/fetch.c. For this commit, I checked all C source and header files not in deps/ and transitioned to the appropriate format specifier where appropriate.
2015-07-12 19:55:19 +02:00
Carlos Martín Nieto
6c7e86e158
examples: modernise the fetch example
...
Under normal conditions, git_remote_fetch() should be the only function
used to perform a fetch. Don't let the example lead people astray.
2015-07-12 19:41:01 +02:00
Carlos Martín Nieto
01d0c02dba
refdb: delete a ref's reflog upon deletion
...
Removing a reflog upon ref deletion is something which only some
backends might wish to do. Backends which are database-backed may wish
to archive a reflog, log-based ones may not need to do anything.
2015-07-12 19:08:06 +02:00
Carlos Martín Nieto
4de7f3bfc3
filter: make sure to close the stream even on error
...
When the stream list init or write fail, we must also make sure to close
the stream, as that's the function contract.
2015-07-12 13:28:03 +02:00
Carlos Martín Nieto
247d27c2c6
index: allow add_bypath to update submodules
...
Similarly to how git itself does it, allow the index update operation to
stage a change in a submodule's HEAD.
2015-07-12 12:11:22 +02:00
Carlos Martín Nieto
0d98af0911
blob: fail to create a blob from a dir with EDIRECTORY
...
This also affects `git_index_add_bypath()` by providing a better error
message and a specific error code when a directory is passed.
2015-07-12 12:11:22 +02:00
Carlos Martín Nieto
8a52ed7a48
errors: add EDIRECTORY
...
This is to be returned when the operation which the user asked for is
not possible to do on a directory.
2015-07-12 12:11:22 +02:00