summaryrefslogtreecommitdiff
path: root/src/path.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | GetFileAttributes does not work for utf-8 encoded pathsSven Strickroth2012-04-201-9/+1
|/ | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Fixing memory leaks indicated by valgrindRussell Belfer2012-03-021-0/+2
| | | | | This clears up the memory leaks that valgrind seems to find on my machine.
* Update diff to use iteratorsRussell Belfer2012-03-021-0/+43
| | | | | | | | | | | | | This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.
* Fix readdir usage across platformsRussell Belfer2012-02-231-3/+3
| | | | | | This fixes the missing readdir_r from win32 and fixes other platforms to always use the reentrant readdir_r form for reading directory contents.
* Fix iterators based on pull request feedbackRussell Belfer2012-02-221-12/+8
| | | | | | | | | | This update addresses all of the feedback in pull request #570. The biggest change was to create actual linked list stacks for storing the tree and workdir iterator state. This cleaned up the code a ton. Additionally, all of the static functions had their 'git_' prefix removed, and a lot of other unnecessary changes were removed from the original patch.
* Uniform iterators for trees, index, and workdirRussell Belfer2012-02-211-0/+65
| | | | | | | | | | | | | | | This create a new git_iterator type of object that provides a uniform interface for iterating over the index, an arbitrary tree, or the working directory of a repository. As part of this, git ignore support was extended to support push and pop of directory-based ignore files as the working directory is being traversed (so the array of ignores does not have to be recreated at each directory during traveral). There are a number of other small utility functions in buffer, path, vector, and fileops that are included in this patch that made the iterator implementation cleaner.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Move path related functions from fileops to pathRussell Belfer2012-01-171-1/+174
| | | | | | | | | | | This takes all of the functions that look up simple data about paths (such as `git_futils_isdir`) and moves them over to path.h (becoming `git_path_isdir`). This leaves fileops.h just with functions that actually manipulate the filesystem or look at the file contents in some way. As part of this, the dir.h header which is really just for win32 support was moved into win32 (with some minor changes).
* Fix several memory issuesRussell Belfer2012-01-111-1/+3
| | | | | | | This contains fixes for several issues discovered by MSVC and by valgrind, including some bad data access, some memory leakage (in where certain files were not being successfully added to the cache), and some code simplification.
* Convert git_path_walk_up to regular functionRussell Belfer2012-01-111-0/+42
| | | | | | This gets rid of the crazy macro version of git_path_walk_up and makes it into a normal function that takes a callback parameter. This turned out not to be too messy.
* Restore portability to git_path_prettify.Russell Belfer2012-01-091-11/+5
| | | | | | | It turns out that passing NULL for the second parameter of realpath(3) is not as portable as one might like. Notably, Mac OS 10.5 and earlier does not support it. So this moves us back to a large buffer to get the realpath info.
* Merge remote-tracking branch 'nulltoken/topix/path_fromurl' into developmentVicent Martí2012-01-041-0/+74
|\ | | | | | | | | | | Conflicts: tests-clay/clay.h tests-clay/clay_main.c
| * path: add git_path_fromurl()nulltoken2011-12-281-0/+35
| |
| * path: add git__percent_decode()nulltoken2011-12-281-0/+35
|/
* Use git_buf for path storage instead of stack-based buffersRussell Belfer2011-12-071-99/+68
| | | | | | | | | | | | | | | | | | | | This converts virtually all of the places that allocate GIT_PATH_MAX buffers on the stack for manipulating paths to use git_buf objects instead. The patch is pretty careful not to touch the public API for libgit2, so there are a few places that still use GIT_PATH_MAX. This extends and changes some details of the git_buf implementation to add a couple of extra functions and to make error handling easier. This includes serious alterations to all the path.c functions, and several of the fileops.c ones, too. Also, there are a number of new functions that parallel existing ones except that use a git_buf instead of a stack-based buffer (such as git_config_find_global_r that exists alongsize git_config_find_global). This also modifies the win32 version of p_realpath to allocate whatever buffer size is needed to accommodate the realpath instead of hardcoding a GIT_PATH_MAX limit, but that change needs to be tested still.
* global: Properly use `git__` memory wrappersVicent Marti2011-10-281-2/+2
| | | | | Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
* Tabify everythingVicent Marti2011-09-191-66/+66
| | | | | | There were quite a few places were spaces were being used instead of tabs. Try to catch them all. This should hopefully not break anything. Except for `git blame`. Oh well.
* Cleanup legal dataVicent Marti2011-09-191-0/+6
| | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* Fix for issue #387Jerome Lambourg2011-09-021-0/+10
|
* fileops: Drop `git_fileops_prettify_path`Vicent Marti2011-07-051-0/+50
| | | | | | | | | | The old `git_fileops_prettify_path` has been replaced with `git_path_prettify`. This is a much simpler method that uses the OS's `realpath` call to obtain the full path for directories and resolve symlinks. The `realpath` syscall is the original POSIX call in Unix system and an emulated version under Windows using the Windows API.
* fileops: CleanupVicent Marti2011-07-051-0/+204
Cleaned up the structure of the whole OS-abstraction layer. fileops.c now contains a set of utility methods for file management used by the library. These are abstractions on top of the original POSIX calls. There's a new file called `posix.c` that contains emulations/reimplementations of all the POSIX calls the library uses. These are prefixed with `p_`. There's a specific posix file for each platform (win32 and unix). All the path-related methods have been moved from `utils.c` to `path.c` and have their own prefix.