Commit Graph

307 Commits

Author SHA1 Message Date
nulltoken
d046945cef Fix MSVC compilation errors 2012-06-22 16:42:37 +03:00
Michael Schubert
f7292a990c tests-clar: mark unused variables 2012-06-22 10:13:50 +02:00
Vicent Martí
fb8aa9e11b Merge pull request #782 from nulltoken/topic/branch-foreach
Branch foreach
2012-06-21 20:12:50 -07:00
nulltoken
d4827081ea branch: drop git_branch_list() 2012-06-21 18:51:32 +02:00
nulltoken
a8fd805e2f branch: add git_branch_foreach() 2012-06-21 18:51:27 +02:00
Michael Schubert
dca6b228d1 notes: fix memory leaks 2012-06-21 10:33:24 +02:00
Carlos Martín Nieto
9311423c34 tests: plug a leak in the repo tests
The second call to assert_config_entry_on_init_bytype is cleaned up by
the main cleanup function, but that overwrites the first _repo. Make
sure that one doesn't leak.
2012-06-21 02:30:30 +02:00
Ben Straub
eb6bc45f6d Avoid uninitialized variable error. 2012-06-19 21:11:48 -07:00
Carlos Martín Nieto
cdca82c784 Plug a few leaks 2012-06-20 00:46:34 +02:00
Vicent Martí
c3ce8d0c9a Merge pull request #775 from arrbee/fix-index-filemodes
Make index add/append support core.filemode flag
2012-06-19 15:17:35 -07:00
Vicent Martí
5232994072 Merge pull request #768 from nulltoken/topic/expose-message-prettify
message: Expose git_message_prettify()
2012-06-19 15:04:45 -07:00
Russell Belfer
da825c92d9 Make index add/append support core.filemode flag
This fixes git_index_add and git_index_append to behave more like
core git, preserving old filemode data in the index when adding
and/or appending with core.filemode = false.

This also has placeholder support for core.symlinks and
core.ignorecase, but those flags are not implemented (well,
symlinks has partial support for preserving mode information in
the same way that git does, but it isn't tested).
2012-06-19 14:27:02 -07:00
Ben Straub
2c90145aad Fix potential segfault in revparse. 2012-06-19 09:25:55 -07:00
nulltoken
743a4b3bdd message: Expose git_message_prettify()
git_commit() and git_tag() no longer prettify the
message by default. This has to be taken care of
by the caller.

This has the nice side effect of putting the
caller in position to actually choose to strip
the comments or not.
2012-06-19 10:02:22 +02:00
Vicent Martí
68f527c448 Merge pull request #758 from libgit2/config-values-containing-quotes
Quotes inside config values don't survive serialization/deserialization
2012-06-18 17:50:12 -07:00
Vicent Marti
8c4c357f18 clar: Fix warnings 2012-06-19 02:43:36 +02:00
Vicent Martí
31eed56b9e Merge pull request #753 from nulltoken/topic/merge-base-many
Expose git_merge_base_many()
2012-06-18 17:36:14 -07:00
Vicent Marti
b93688d06d Merge remote-tracking branch 'yorah/fix/notes-creation' into development
Conflicts:
	src/notes.c
2012-06-19 02:33:03 +02:00
Vicent Marti
515a4c7c06 tree: Proper path comparison logic 2012-06-19 00:59:04 +02:00
Tim Clem
e00b56eb04 Fix broken tests caused by no longer prettifying by default 2012-06-15 10:18:08 -07:00
Carlos Martín Nieto
67d334c1cd config: add more tests for writing escaped chars 2012-06-13 23:26:00 +02:00
Adam Roben
750be86aed Add a test that shows we don't preserve quotes in config values 2012-06-13 21:43:34 +02:00
Frederick Ros
fa45d25f38 Fix issue #763 2012-06-13 17:35:13 +02:00
yorah
027d77ee5c notes: simplify tests 2012-06-12 14:30:33 +02:00
nulltoken
7623b1b63f repository: make git_repository_init() value the core.logallrefupdates config entry 2012-06-12 06:42:46 +02:00
nulltoken
976b69bdbb repository: widen test coverage regarding initialization and configuration entries 2012-06-12 06:42:46 +02:00
Adam Roben
cfc17dc41b Add a test showing that git_status_file gets confused by spaces in .gitignore 2012-06-09 17:43:18 -04:00
Russell Belfer
145e696b49 Minor fixes, cleanups, and clarifications
There are three actual changes in this commit:

1. When the trailing newline of a file is removed in a diff, the
   change will now be reported with `GIT_DIFF_LINE_DEL_EOFNL` passed
   to the callback.  Previously, the `ADD_EOFNL` constant was given
   which was just an error in my understanding of when the various
   circumstances arose.  `GIT_DIFF_LINE_ADD_EOFNL` is deprecated and
   should never be generated.  A new newline is simply an `ADD`.
2. Rewrote the `diff_delta__merge_like_cgit` function that contains
   the core logic of the `git_diff_merge` implementation.  The new
   version doesn't actually have significantly different behavior,
   but the logic should be much more obvious, I think.
3. Fixed a bug in `git_diff_merge` where it freed a string pool
   while some of the string data was still in use.  This led to
   `git_diff_print_patch` accessing memory that had been freed.

The rest of this commit contains improved documentation in `diff.h`
to make the behavior and the equivalencies with core git clearer,
and a bunch of new tests to cover the various cases, oh and a minor
simplification of `examples/diff.c`.
2012-06-08 12:11:13 -07:00
Russell Belfer
0abd724454 Fix filemode comparison in diffs
File modes were both not being ignored properly on platforms
where they should be ignored, nor be diffed consistently on
platforms where they are supported.

This change adds a number of diff and status filemode change
tests.  This also makes sure that filemode-only changes are
included in the diff output when they occur and that filemode
changes are ignored successfully when core.filemode is false.

There is no code that automatically toggles core.filemode
based on the capabilities of the current platform, so the user
still needs to be careful in their .git/config file.
2012-06-08 12:09:10 -07:00
yorah
a02e724978 notes: simplify the handling of fanouts
- Do not create new levels of fanout when creating notes from libgit2
 - Insert a note in an existing matching fanout
 - Remove a note from an existing fanout
 - Cleanup git_note_read, git_note_remove, git_note_foreach, git_note_create methods in order use tree structures instead of tree_oids
2012-06-08 20:34:24 +02:00
Ben Straub
e272efcb20 Tests: wrap 'getenv' and friends for Win32 tests. 2012-06-08 11:24:37 -07:00
yorah
3a0d1e12db notes: add failing test 2012-06-08 00:17:09 +02:00
yorah
454cc829f3 notes: add test resource with faked two-level fanout 2012-06-08 00:17:08 +02:00
Vicent Martí
3f0358604e misc: Fix warnings from PVS Studio trial 2012-06-07 22:43:48 +02:00
Ben Straub
763b838152 Fixing rev-parse-induced Travis errors. 2012-06-07 13:22:50 -07:00
Vicent Martí
6c08e69fd9 Merge pull request #669 from nulltoken/topic/reset
Add git_reset()
2012-06-07 12:30:20 -07:00
Vicent Martí
b9ebcc59e7 Merge pull request #684 from benstraub/rev-parse
Rev parse
2012-06-07 12:29:31 -07:00
nulltoken
edebceffef Add git_reset()
Currently supports Soft and Mixed modes.
2012-06-07 21:27:30 +02:00
Vicent Martí
cddb8efe56 Merge pull request #704 from nulltoken/topic/blob_fromchunks
Add the ability to create blob given a provider of chunks of bytes
2012-06-07 11:34:48 -07:00
nulltoken
cd44576790 blob: add git_blob_create_fromchunks() 2012-06-07 20:33:22 +02:00
Vicent Martí
5bb545822d Merge pull request #752 from nulltoken/fix/warning
Fix compilation warning and failing test
2012-06-07 09:44:08 -07:00
nulltoken
b46bdb2204 merge: Expose git_merge_base_many() 2012-06-07 16:25:37 +02:00
Adam Roben
8e60c712ac Fix git_status_file for files that start with a character > 0x7f
git_status_file would always return GIT_ENOTFOUND for these files.

The underlying bug was that git__strcmp_cb, which is used by
git_path_with_stat_cmp to sort entries in the working directory,
compares strings based on unsigned chars (this is confirmed by the
strcmp(3) manpage), while git__prefixcmp, which is used by
workdir_iterator__entry_cmp to search for a path in the working
directory, compares strings based on char. So the sort puts this path at
the end of the list, while the search expects it to be at the beginning.

The fix was simply to make git__prefixcmp compare using unsigned chars,
just like strcmp(3). The rest of the change is just adding/updating
tests.
2012-06-07 09:50:19 -04:00
nulltoken
6183f0e2b2 merge: cleanup tests 2012-06-07 14:55:24 +02:00
nulltoken
6654dbe320 tests: fix assertion 2012-06-07 14:09:25 +02:00
Ben Straub
36c0802245 Omit failing test on 32-bit machines.
This test is intended to verify that 64-bit
machines can handle parsing dates in 2039 and
beyond, and fails on 32-bit machines. It is now
omitted when run on a 32-bit machine to eliminate
an expected failure.
2012-06-06 12:39:29 -07:00
Ben Straub
8a385c0482 Move git__date_parse declaration to util.h. 2012-06-06 12:25:22 -07:00
Vicent Martí
eadc0e03f1 Merge pull request #747 from nulltoken/topic/init-filemode
Make git_repository_init() value "core.filemode" and "core.ignorecase"
2012-06-05 13:41:13 -07:00
nulltoken
693b23c09a repository: make git_repository_init() value the core.ignorecase config entry 2012-06-05 22:33:34 +02:00
Vicent Marti
a146ba9e5b tests: Fix warning with nested comments 2012-06-05 22:16:08 +02:00