| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
.travis.yml
include/git2/diff.h
src/config_file.c
src/diff.c
src/diff_output.c
src/mwindow.c
src/path.c
tests-clar/clar_helpers.c
tests-clar/object/tree/frompath.c
tests/t00-core.c
tests/t03-objwrite.c
tests/t08-tag.c
tests/t10-refs.c
tests/t12-repo.c
tests/t18-status.c
tests/test_helpers.c
tests/test_main.c
|
| |\
| | |
| | | |
Memory pools and khash hashtables
|
| | |
| | |
| | |
| | |
| | |
| | | |
This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to
`git_oidmap`, and deletes `git_hashtable` from the tree, plus
adds unit tests for `git_strmap`.
|
| |/ |
|
| |
| |
| |
| |
| | |
This fixes all the warnings on win64 except those in deps, which
come from the regex code.
|
| |
| |
| |
| |
| | |
Variable values may be quoted to include newlines, literal quotes and
other characters. Add support for these and test it.
|
| |
| |
| |
| | |
git_object is met
|
| |\
| | |
| | | |
Rewrite status using diff
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There was an error in the tree iterator where it would
delete two tree levels instead of just one when popping
up a tree level. Unfortunately the test data for the
tree iterator did not have any deep trees with subtrees
in the middle of the tree items, so this problem went
unnoticed. This contains the 1-line fix plus new test
data and tests that reveal the issue.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This gives `git_status_foreach()` back its old behavior of
emulating the "--untracked=all" behavior of git. You can
get any of the various --untracked options by passing flags
to `git_status_foreach_ext()` but the basic version will
keep the behavior it has always had.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This "fixes" the broken t18 status tests to accurately reflect
the new behavior for "created" untracked subdirectories. See
discussion in the PR for more details.
This also contains the submodules unit test that I forgot to
git add, and ports most of the t18-status.c tests to clar (still
missing a couple of the git_status_file() single file tests).
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is a work in progress. This adds two new sets of tests,
the issue_592 tests from @nulltoken's pull request #601 and
some new tests for submodules. The submodule tests still have
issues where the status is not reported correctly. That needs
to be fixed before merge.
|
| |/ |
|
| |
| |
| |
| |
| | |
Also cleaned up some previously converted code that still had
little things to polish.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This also includes droping `git_buf_lasterror` because it makes no sense
in the new system. Note that in most of the places were it has been
dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so
instead it should return a generic `-1` and obviously not throw
anything.
|
| |
| |
| |
| |
| | |
Yes, this is error handling solely for `refs.c`, but some of the
abstractions leak all ofer the code base.
|
|\ \
| | |
| | | |
Ported t04_commit.c to Clar.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Created a copy of tests/resources/testrepo.git that is compatible
with the Clar sandboxing helpers.
Restructured commit test suites to use Clar sandbox helpers.
Now using typed data arrays rather than lots of macros to define test
cases.
|
| | |
| | |
| | |
| | | |
Removed the BUILD_CLAR CMake flag, and updated the readme.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* t00 / 6e86fb3 (mentioned in #406)
* t01 / fc60c4a (mentioned in #406)
* t03 / bcbabe6
* t04 / PR #606
* t05 / d96f2c3
* t06 / 6c106ee
* t07 / 2ef582b
* t08 / b482c42
* t09 / 9a39a36
* t10 / 00a4893
* t12 / 7c3a4a7
* t13 / 1cb9b31
* t17 / cdaa6ff (mentioned in #406)
* t18 / efabc08
|
|/ /
| |
| |
| | |
Also cleaned up some names for things that used to be macros.
|
|/
|
|
|
| |
To conform the naming scheme of git_oid_fromstr we should change the
name of git_oid_to_string to git_oid_tostr.
|
|
|
|
|
|
|
|
|
| |
This reverts the changes to the GIT_STATUS constants and adds a
new enumeration to describe the type of change in a git_diff_delta.
I don't love this solution, but it should prevent strange errors
from occurring for now. Eventually, I would like to unify the
various status constants, but it needs a larger plan and I just
wanted to eliminate this breakage quickly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5
did not fix the GIT_USUSED behavior on all platforms. This commit
walks through and really cleans things up more thoroughly, getting
rid of the unnecessary stuff.
To remove the use of some GIT_UNUSED, I ended up adding a couple
of new iterators for hashtables that allow you to iterator just
over keys or just over values.
In making this change, I found a bug in the clar tests (where we
were doing *count++ but meant to do (*count)++ to increment the
value). I fixed that but then found the test failing because it
was not really using an empty repo. So, I took some of the code
that I wrote for iterator testing and moved it to clar_helpers.c,
then made use of that to make it easier to open fixtures on a
per test basis even within a single test file.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Once I added tests for the whitespace handling options of
diff, I realized that there were some bugs. This fixes
those and adds the new tests into the test suite.
|
|
|
|
|
|
|
| |
This fixes several bugs, updates tests and docs, eliminates the
FILE* assumption in favor of printing callbacks for the diff patch
formatter helpers, and adds a "diff" example function that can
perform a diff from the command line.
|
|
|
|
|
|
|
|
| |
This gets the basic plumbing in place for git_diff_blob.
There is a known issue where additional parameters like
the number of lines of context to display on the diff
are not working correctly (which leads one of the new
unit tests to fail).
|
|
|
|
|
|
|
| |
Since casting to void works to eliminate errors with unused
parameters on all platforms, avoid the various special cases.
Over time, it will make sense to eliminate the GIT_UNUSED
macro completely and just have GIT_UNUSED_ARG.
|
|
|
|
|
| |
This is a test that should replicate an issue that Peff
is setting with git attributes. But the test doesn't fail.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
Add unit tests to confirm ignore directory pattern matches and
to confirm that ignore and attribute files are loaded properly
into the attribute file cache.
|
| |
|
|\
| |
| |
| | |
This resolves issue #535 and issue #533.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Per issue #533, the handling of relative paths in attribute
and ignore files was not right. Fixed this by pre-joining
the relative path of the attribute/ignore file onto the match
string when a full path match is required.
Unfortunately, fixing this required a bit more code than I
would have liked because I had to juggle things around so that
the fnmatch parser would have sufficient information to prepend
the relative path when it was needed.
|
|/
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
| |
This fixes issue 532 that attributes (and gitignores) could not
be checked for files that don't exist. It should be possible to
query such things regardless of the existence of the file.
|
| |
|
|
|
|
|
|
|
|
| |
Adds support for .gitignore files to git_status_foreach() and
git_status_file(). This includes refactoring the gitattributes
code to share logic where possible. The GIT_STATUS_IGNORED flag
will now be passed in for files that are ignored (provided they
are not already in the index or the head of repo).
|
|\
| |
| |
| |
| |
| | |
Conflicts:
tests-clay/clay.h
tests-clay/clay_main.c
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This updates to implementation of gitattribute macros to be much more
similar to core git (albeit not 100%) and to handle expansion of
macros within macros, etc. It also cleans up the refcounting usage
with macros to be much cleaner.
Also, this adds a new vector function `git_vector_insert_sorted()`
which allows you to maintain a sorted list as you go. In order to
write that function, this changes the function `git__bsearch()` to
take a somewhat different set of parameters, although the core
functionality is still the same.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add support for git attribute macro definitions. Also, add
support for cache flush API to clear the attribute file content
cache when needed.
Additionally, improved the handling of global and system files,
making common utility functions in fileops and converting config
and attr to both use the common functions.
Adds a bunch more tests and fixed some memory leaks. Note that
adding macros required me to use refcounted attribute assignment
definitions, which complicated, but probably improved memory usage.
|
|/
|
|
|
|
|
|
|
| |
This adds APIs for querying git attributes. In addition to
the new API in include/git2/attr.h, most of the action is in
src/attr_file.[hc] which contains utilities for dealing with
a single attributes file, and src/attr.[hc] which contains
the implementation of the APIs that merge all applicable
attributes files.
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was not safe for git_buf_joinpath to be used with a pointer
into the buf itself because a reallocation could invalidate
the input parameter that pointed into the buffer. This patch
makes it safe to self join, at least for the leading input to
the join, which is the common "append" case for self joins.
Also added unit tests to explicitly cover this case.
This should actually fix #511
|