Commit Graph

17 Commits

Author SHA1 Message Date
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
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
454cc829f3 notes: add test resource with faked two-level fanout 2012-06-08 00:17:08 +02:00
Vicent Martí
b9ebcc59e7 Merge pull request #684 from benstraub/rev-parse
Rev parse
2012-06-07 12:29:31 -07: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
Ben Straub
56a5000d58 Merge branch 'development' into rev-parse
Conflicts:
	src/util.h
	tests-clar/refs/branches/listall.c
2012-06-05 12:52:44 -07:00
Russell Belfer
bd4ca902b5 Fix status for files under ignored dirs
There was a bug where tracked files inside directories that were
inside ignored directories where not being found by status.  To
make that a little clearer, if you have a .gitignore with:

    ignore/

And then have the following files:

    ignore/dir/tracked     <-- actually a tracked file
    ignore/dir/untracked   <-- should be ignored

Then we would show the tracked file as being removed (because
when we got the to contained item "dir/" inside the ignored
directory, we decided it was safe to skip -- bzzt, wrong!).

This update is much more careful about checking that we are
not skipping over any prefix of a tracked item, regardless of
whether it is ignored or not.

As documented in diff.c, this commit does create behavior that
still differs from core git with regards to the handling of
untracked files contained inside ignored directories.  With
libgit2, those files will just not show up in status or diff.
With core git, those files don't show up in status or diff
either *unless* they are explicitly ignored by a .gitignore
pattern in which case they show up as ignored files.

Needless to say, this is a local behavior difference only, so
it should not be important and (to me) the libgit2 behavior
seems more consistent.
2012-05-16 17:08:59 -07:00
Han-Wen Nienhuys
24634c6fd0 Handle duplicate objects from different backends in git_odb_read_prefix(). 2012-05-12 15:50:19 -03:00
Ben Straub
92ad5a5cda Rebasing onto libgit2/development: cleanup. 2012-05-11 11:55:20 -07:00
Ben Straub
a6346302e6 Rev-parse: "ref@{upstream}" syntax.
Added tracking configuration to the test repo's
config to support unit tests.
2012-05-11 11:30:47 -07:00
nulltoken
cfe25b13fa tests: add two binary blobs to attr test repository
- edf3dce -> assets.github.com/images/icons/emoji/alien.png?v5
 - de863bf -> assets.github.com/images/icons/emoji/heart.png?v5
2012-05-07 12:18:32 +02:00
Russell Belfer
3ec1fa5e1c Fixing issue with test data 2012-05-04 13:55:07 -07:00
Russell Belfer
f917481ee8 Support reading attributes from index
Depending on the operation, we need to consider gitattributes
in both the work dir and the index.  This adds a parameter to
all of the gitattributes related functions that allows user
control of attribute reading behavior (i.e. prefer workdir,
prefer index, only use index).

This fix also covers allowing us to check attributes (and
hence do diff and status) on bare repositories.

This was a somewhat larger change that I hoped because it had
to change the cache key used for gitattributes files.
2012-05-03 16:37:25 -07:00
Vicent Martí
a1d0802576 Backport more test data 2012-05-02 16:33:26 -07:00
Vicent Martí
8c83fead91 Move test resources 2012-05-02 16:18:55 -07:00
Vicent Martí
40879facad Merge branch 'new-error-handling' into development
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
2012-05-02 15:59:02 -07:00
Ben Straub
fd29cd13b7 Moved testing resources to clar, and removed old tests directory.
Removed the BUILD_CLAR CMake flag, and updated the readme.
2012-03-31 16:10:01 -07:00