Commit Graph

2646 Commits

Author SHA1 Message Date
Russell Belfer
d17db71b6f isalpha is not great for UTF-8
When checking for a drive letter on windows, instead of using
isalpha(), it is better to just check for a..z and A..Z, I think,
particularly because the MS isalpha implementation appears to
assert when given an 0xFF byte.
2012-06-08 13:56:53 -07: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
Chris Young
4c650c2b80 Don't use the PPC native SHA1 :( CMake is refusing to acknowledge the sha1ppc.S ppc asm code. 2012-06-08 19:55:04 +01:00
Chris Young
c3f7a9386d Re-add the ability to select the PowerPC SHA1 function 2012-06-08 19:37:24 +01:00
Vicent Martí
80c03754ae Merge pull request #757 from benstraub/development
Tests: wrap 'getenv' and friends for Win32 tests.
2012-06-08 11:36:49 -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
nulltoken
b0b3b4e39e treebuilder: prevent git_treebuilder_free() from segfaulting when being passed a NULL treebuilder 2012-06-08 20:34:13 +02:00
Ben Straub
e272efcb20 Tests: wrap 'getenv' and friends for Win32 tests. 2012-06-08 11:24:37 -07:00
Chris Young
fa56478fb8 Generic needs compat files 2012-06-08 19:15:11 +01:00
Chris Young
aa5a92d121 OS4 compatibility 2012-06-08 18:57:35 +01: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
Chris Young
519757279e Fix double-defines when using GIT_OLD_ERRORS 2012-06-07 23:13:39 +01:00
Chris Young
0f5e1f3b68 Network byte order is big-endian - the way it should be :) 2012-06-07 21:56:19 +01:00
Vicent Martí
3f0358604e misc: Fix warnings from PVS Studio trial 2012-06-07 22:43:48 +02:00
Chris Young
6b5db63c15 random page size for os4 2012-06-07 21:40:07 +01:00
Chris Young
c41fc47512 horrid gethostbyname compatibility 2012-06-07 21:26:39 +01:00
Ben Straub
763b838152 Fixing rev-parse-induced Travis errors. 2012-06-07 13:22:50 -07:00
Chris Young
2774ccb851 no fnmatch.h 2012-06-07 20:40:34 +01:00
Chris Young
fb0b1523c4 force disable of openssl, confusing cross-compiler 2012-06-07 20:40:03 +01: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
Chris Young
c3f35902f3 Merge remote-tracking branch 'source/development' into update-test
Merging main libgit2!
Conflicts:
	CMakeLists.txt
	src/unix/map.c
2012-06-07 20:29:22 +01:00
Ben Straub
327dc61f13 Prefer git__free (again). 2012-06-07 12:28:08 -07:00
nulltoken
edebceffef Add git_reset()
Currently supports Soft and Mixed modes.
2012-06-07 21:27:30 +02:00
Ben Straub
31dda64716 Rename internal function. 2012-06-07 12:16:39 -07: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
Vicent Martí
9bc57e5671 Merge pull request #751 from libgit2/8bit-filename-status
git_status_file returns GIT_ENOTFOUND for "域名检测工具.exe" (and similarly named files)
2012-06-07 09:37:23 -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
Adam Roben
b9f78cb87b Ingore clar_main.c.rule 2012-06-07 09:49:52 -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
nulltoken
6f944ab196 Fix compilation warning 2012-06-07 13:36:28 +02:00
Ben Straub
9ecf860d48 Rename posix wrappers with 'p_' prefix. 2012-06-06 13:24:25 -07:00
Ben Straub
1a728066c3 Remove 'git__' prefix from a static function. 2012-06-06 13:04:08 -07:00
Ben Straub
d6391a626f Rev-parse: stop referencing freed memory.
Converted an internal utility to return an oid, 
rather than a tree entry (whose lifetime is tied
to the parent tree, which was freed before 
returning).
2012-06-06 13:00:12 -07: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
19d35d528c Prefer git__free() to free(). 2012-06-06 12:31:48 -07:00
Ben Straub
8a385c0482 Move git__date_parse declaration to util.h. 2012-06-06 12:25:22 -07:00
Ben Straub
2c2cde47b8 Fix signatures for tree calls. 2012-06-06 08:41:39 -07:00
Carlos Martín Nieto
66798ad0d8 Don't include arpa/inet.h on Windows 2012-06-06 11:00:15 +02:00
Michael Schubert
fdc5c38e40 transports: fix buglet 2012-06-05 23:03:06 +02:00
Vicent Martí
966fbdcb8e Merge pull request #697 from carlosmn/ssl
Add HTTPS support
2012-06-05 13:53:33 -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 Martí
8fc1e0c819 Merge pull request #738 from nacho/development
libgit2-glib bindings moved to gnome servers
2012-06-05 13:18:29 -07:00