Commit Graph

14 Commits

Author SHA1 Message Date
Russell Belfer
618b7689e1 Wrap iconv stuff and write tests
This adds a simple wrapper around the iconv APIs and uses it
instead of the old code that was inlining the iconv stuff.  This
makes it possible for me to test the iconv logic in isolation.
A "no iconv" version of the API was defined with macros so that
I could have fewer ifdefs in the code itself.
2013-10-03 10:44:13 -07:00
Russell Belfer
cae5293854 Fix resolving relative windows network paths 2013-09-03 14:00:27 -07:00
Russell Belfer
0d1af399e9 don't use inline in tests for win32 2013-09-03 12:33:34 -07:00
Nikolai Vladimirov
6d9a6c5cec path: properly resolve relative paths 2013-09-03 20:45:53 +03:00
Philip Kelley
8c29dca6c3 Fix some incorrect MSVC #ifdef's. Fixes #1305 2013-02-11 09:25:57 -05:00
nulltoken
50a762a563 path: Teach UNC paths to git_path_dirname_r()
Fix libgit2/libgit2sharp#256
2012-12-26 23:07:25 +01:00
nulltoken
34b6f05f39 path: enhance git_path_dirname_r() test coverage 2012-12-26 11:59:07 +01:00
Russell Belfer
b0fe112922 Add path utilities to resolve relative paths
This makes it easy to take a buffer containing a path with relative
references (i.e. .. or . path segments) and resolve all of those
into a clean path.  This can be applied to URLs as well as file
paths which can be useful.

As part of this, I made the drive-letter detection apply on all
platforms, not just windows.  If you give a path that looks like
"c:/..." on any platform, it seems like we might as well detect
that as a rooted path.  I suppose if you create a directory named
"x:" on another platform and want to use that as the beginning
of a relative path under the root directory of your repo, this
could cause a problem, but then it seems like you're asking for
trouble.
2012-07-10 23:19:47 -07: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
Russell Belfer
1a6e8f8a54 Update clar and remove old helpers
This updates to the latest clar which includes the helpers
`cl_assert_equal_s` and `cl_assert_equal_i`.  Convert the code
over to use those and remove the old libgit2-only helpers.
2012-04-17 10:35:11 -07:00
Russell Belfer
0d0fa7c368 Convert attr, ignore, mwindow, status to new errors
Also cleaned up some previously converted code that still had
little things to polish.
2012-03-16 15:56:01 -07:00
nulltoken
7b93079b5b Make git_path_root() cope with windows network paths
Fix libgit2/libgit2sharp#125
2012-03-16 15:16:52 +01:00
Vicent Martí
13224ea4aa buffer: Unify git_fbuffer and git_buf
This makes so much sense that I can't believe it hasn't been done
before. Kill the old `git_fbuffer` and read files straight into
`git_buf` objects.

Also: In order to fully support 4GB files in 32-bit systems, the
`git_buf` implementation has been changed from using `ssize_t` for
storage and storing negative values on allocation failure, to using
`size_t` and changing the buffer pointer to a magical pointer on
allocation failure.

Hopefully this won't break anything.
2012-02-27 05:30:07 +01:00
Vicent Martí
3fd1520cd4 Rename the Clay test suite to Clar
Clay is the name of a programming language on the makings, and we want
to avoid confusions. Sorry for the huge diff!
2012-01-24 20:35:15 -08:00