Commit Graph

7 Commits

Author SHA1 Message Date
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