Commit Graph

2327 Commits

Author SHA1 Message Date
Scott J. Goldman
6fb1c0b489 Fix readdir_r() usage for Solaris
On Solaris, struct dirent is defined differently than Linux. The field
containing the path name is of size 0, rather than NAME_MAX. So, we need to
use a properly sized buffer on Solaris to avoid a stack overflow.

Also fix some DIR* leaks on cleanup.
2012-05-12 09:51:32 -07:00
Scott J. Goldman
b1ec25facc Fix comment typo in common.h 2012-05-10 17:16:38 -07:00
Scott J. Goldman
54bdc64a92 Fix rmdir() usage on Solaris
On Solaris, rmdir() throws EEXIST if the folder is not empty, so just add
one more case to check for that, alongside ENOTEMPTY.
2012-05-10 17:13:06 -07:00
Scott J. Goldman
ec42eafd4a Hook up Windows compat fnmatch() for Solaris
Since Solaris does not support some of the same flags as glibc fnmatch(),
we just use the implementation we have for Windows.

Now that it's no longer a windows-specific thing, I moved it into compat/
instead of win32/
2012-05-10 09:52:49 -07:00
Vicent Martí
a9d9965b35 clar: Update from upstream 2012-05-09 22:55:01 +02:00
Vicent Martí
4374f1871f Merge pull request #678 from nulltoken/fix/msvc-weird-error
Fix MSVC compilation issue
2012-05-09 12:34:13 -07:00
nulltoken
1956693fa0 Fix MSVC compilation issue
exp() is already defined in math.h. This leads to LMSVC complaining

    ..\..\libgit2\tests-clar\diff\blob.c(5): error C2365: 'exp' : redefinition; previous definition was 'function'

    Renaming the variable fixes this issue.
2012-05-09 21:14:49 +02:00
Russell Belfer
2aa1e94d30 Fix 64-bit build warning 2012-05-09 10:30:34 -07:00
Russell Belfer
075d6e7dd7 Merge pull request #679 from nulltoken/fix/git__isspace
util: Fix git__isspace() implementation
2012-05-09 10:18:54 -07:00
Michael Schubert
b470019f7f tests-clar/diff: fix missing-prototype warning 2012-05-09 18:02:13 +02:00
Carlos Martín Nieto
11678b3718 fetch: filter tag annotation pseudo-refs while generating wants
These objects aren't considered as being advertised, so asking for
them will cause the remote end to close the connection. This makes the
checking in update_tips() unnecessary, because they don't get inserted
in the list.
2012-05-09 16:18:13 +02:00
Carlos Martín Nieto
0536afcaa9 remote: don't try to create tag annotations as refs/tags/v0.1.0^{}
Skip them for now. Eventually we might want to filter these out
earler.
2012-05-09 14:10:30 +02:00
nulltoken
9cd25d0003 util: Fix git__isspace() implementation
The characters <space>, <form-feed>, <newline>, <carriage-return>, <tab>, and <vertical-tab> are part of the "space" definition.

cf. http://www.kernel.org/doc/man-pages/online/pages/man5/locale.5.html
2012-05-09 13:21:21 +02:00
Carlos Martín Nieto
a640d79e84 indexer: close the pack's fd before renaming it
Windows gets upset if we rename a file with an open descriptor.
2012-05-09 13:11:50 +02:00
Vicent Martí
0f49200c9a msvc: Do not use isspace
Locale-aware bullshit bitting my ass again yo
2012-05-09 04:37:02 +02:00
Vicent Martí
e65752bb32 Merge pull request #677 from arrbee/status-without-head
Add support for diffing index with no HEAD
2012-05-08 16:06:27 -07:00
Russell Belfer
7e000ab2ec Add support for diffing index with no HEAD
When a repo is first created, there is no HEAD yet and attempting
to diff files in the index was showing nothing because a tree
iterator could not be constructed.  This adds an "empty" iterator
and falls back on that when the head cannot be looked up.
2012-05-08 15:03:59 -07:00
Vicent Martí
fd5faae346 message: Cleanup 2012-05-08 23:55:37 +02:00
Vicent Martí
b1e2ba275a message: Proper OOM handling 2012-05-08 23:43:52 +02:00
Vicent Martí
c99bdacf71 Merge pull request #670 from nulltoken/ntk/topic/clean-commit_message
Clean commit and tag messages
2012-05-08 14:13:43 -07:00
Russell Belfer
364f51bdca Merge pull request #668 from nulltoken/topic/binary-blobs
Enhancing the blob diffing experience
2012-05-08 13:56:21 -07:00
Vicent Martí
1f796cd180 Merge pull request #676 from carlosmn/remotes
Add git_remote_add() and change signature for _new()
2012-05-08 13:42:11 -07:00
Russell Belfer
19579847f6 Clean up warnings and tests 2012-05-08 13:23:00 -07:00
Carlos Martín Nieto
baaa8a447e remotes: change git_remote_new's signature
Add a fetch refspec arguemnt and make the arguments (name, url,
refspec), as that order makes more sense.
2012-05-08 21:36:40 +02:00
Carlos Martín Nieto
a209a025c6 remote: add git_remote_add()
Helper function to create a remote with the default settings
2012-05-08 21:36:40 +02:00
Carlos Martín Nieto
3df9cc5922 config: don't use freed memory on error
Change the order and set a NULL so we don't try to access freed memory
in case of an error.
2012-05-08 21:35:51 +02:00
Russell Belfer
2c0cdc3a86 Merge pull request #674 from nulltoken/topic/GIT_ENOTFOUND
Improve the interop with bindings
2012-05-08 10:40:01 -07:00
Carlos Martín Nieto
65ca81a63e Minor error fixes
Clear the error in pkt when we notice that the remote is starting to
send the packfile.

Fix the format string for Windows networking errors.
2012-05-08 14:28:21 +02:00
nulltoken
722c08afec status: Prevent git_status_file() from returning ENOTFOUND when not applicable 2012-05-08 10:05:27 +02:00
nulltoken
464cf248fd repository: ensure git_repository_discover() returns ENOTFOUND when unable to find a repository given the constraints 2012-05-08 10:05:24 +02:00
nulltoken
0b0957a661 fileops: replace integer usage with more explicit enum in some git_futils_rmdir_r() calls 2012-05-08 10:05:22 +02:00
nulltoken
d7d8a0bfd4 repository: ensure git_repository_open() returns ENOTFOUND when being passed a path leading to no repository 2012-05-08 10:05:20 +02:00
nulltoken
9abb5bca5d compat: make p_realpath Windows implementation be a bit more POSIX compliant and fail if the provided path does not lead to an existing entry 2012-05-08 10:05:18 +02:00
nulltoken
46811561ae path: Make git_path_prettify() properly handle ENOTDIR errno value 2012-05-08 10:05:16 +02:00
nulltoken
cb0ce16bbe object: make git_object_lookup() return GIT_ENOTFOUND when searching for an existing object by specifying an incorrect type 2012-05-08 10:05:14 +02:00
nulltoken
9fb70f378a remote: make git_remote_load() return GIT_ENOTFOUND when the remote url cannot be retrieved from the config file 2012-05-08 10:05:12 +02:00
nulltoken
2fb9d6de95 remote: ensure the allocated remote is freed when an error occurs during its loading 2012-05-08 10:05:09 +02:00
Vicent Martí
8d89c8e972 Merge pull request #672 from scottjg/more-mingw32-fixes
More mingw32 compilation fixes.
2012-05-07 13:36:02 -07:00
Russell Belfer
cba285d32f Fix directory finding for attrs
The fix to support attrs on bare repos went a little too far
in trying to avoid using the working directory and ended up
not processing the input path quite correctly.
2012-05-07 13:32:30 -07:00
Russell Belfer
df0c89534d Merge pull request #667 from nulltoken/fix/p_open
compat: make p_open able to accept optional mode when passing the O_CREAT flag
2012-05-07 10:20:49 -07:00
Carlos Martín Nieto
c2d82a6533 travis: run the tests verbosely 2012-05-07 12:31:31 +02:00
nulltoken
3191ae89c6 compat: make p_open able to accept optional mode when passing the O_CREAT flag
This has the nice side effect of making test_attr_repo__staging_properly_normalizes_line_endings_according_to_gitattributes_directives() test pass again on Windows. This test started to fail after commit 674a198 was applied.
2012-05-07 12:18:54 +02:00
nulltoken
d1c4312a02 diff: improve git_diff_blobs() documentation 2012-05-07 12:18:34 +02:00
nulltoken
9a29f8d56c diff: fix the diffing of two identical blobs 2012-05-07 12:18:33 +02:00
nulltoken
28ef7f9b28 diff: make git_diff_blobs() able to detect binary blobs 2012-05-07 12:18:32 +02:00
nulltoken
cfe25b13fa tests: add two binary blobs to attr test repository
- edf3dce -> assets.github.com/images/icons/emoji/alien.png?v5
 - de863bf -> assets.github.com/images/icons/emoji/heart.png?v5
2012-05-07 12:18:32 +02:00
nulltoken
4f80676182 diff: fix the diffing of a concrete blob against a null one 2012-05-07 12:18:31 +02:00
nulltoken
245c5eaec5 diff: When diffing two blobs, ensure the delta callback parameter is filled with relevant information 2012-05-07 12:18:31 +02:00
nulltoken
8d0f46754f diff: remove unused parameter 2012-05-07 12:18:30 +02:00
nulltoken
458b94503d commit/tag: ensure the message is cleaned up
'git commit' and 'git tag -a' enforce some conventions, like cleaning up excess whitespace and making sure that the last line ends with a '\n'. This fix replicates this behavior.

Fix libgit2/libgit2sharp#117
2012-05-07 12:16:04 +02:00