diff options
author | Adam Roben <adam@roben.org> | 2012-06-07 09:50:19 -0400 |
---|---|---|
committer | Adam Roben <adam@roben.org> | 2012-06-07 09:50:19 -0400 |
commit | 8e60c712acef798a6b3913359f8d9dffcddf7256 (patch) | |
tree | 111d5cfc0e23bceb4a097a369d29c2992255fa37 /tests-clar/status/status_data.h | |
parent | b9f78cb87b7a8cb07a660dacdcb59c9adf733c3f (diff) | |
download | libgit2-8bit-filename-status.tar.gz |
Fix git_status_file for files that start with a character > 0x7f8bit-filename-status
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.
Diffstat (limited to 'tests-clar/status/status_data.h')
-rw-r--r-- | tests-clar/status/status_data.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests-clar/status/status_data.h b/tests-clar/status/status_data.h index f109717e8..043b83009 100644 --- a/tests-clar/status/status_data.h +++ b/tests-clar/status/status_data.h @@ -19,6 +19,8 @@ static const char *entry_paths0[] = { "subdir/deleted_file", "subdir/modified_file", "subdir/new_file", + + "\xe8\xbf\x99", }; static const unsigned int entry_statuses0[] = { @@ -38,9 +40,11 @@ static const unsigned int entry_statuses0[] = { GIT_STATUS_WT_DELETED, GIT_STATUS_WT_MODIFIED, GIT_STATUS_WT_NEW, + + GIT_STATUS_WT_NEW, }; -static const size_t entry_count0 = 15; +static const size_t entry_count0 = 16; /* entries for a copy of tests/resources/status with all content * deleted from the working directory @@ -108,6 +112,7 @@ static const char *entry_paths3[] = { "subdir/current_file", "subdir/deleted_file", "subdir/modified_file", + "\xe8\xbf\x99", }; static const unsigned int entry_statuses3[] = { @@ -132,9 +137,10 @@ static const unsigned int entry_statuses3[] = { GIT_STATUS_WT_DELETED, GIT_STATUS_WT_DELETED, GIT_STATUS_WT_DELETED, + GIT_STATUS_WT_NEW, }; -static const size_t entry_count3 = 21; +static const size_t entry_count3 = 22; /* entries for a copy of tests/resources/status with some mods @@ -163,7 +169,8 @@ static const char *entry_paths4[] = { "subdir/deleted_file", "subdir/modified_file", "zzz_new_dir/new_file", - "zzz_new_file" + "zzz_new_file", + "\xe8\xbf\x99", }; static const unsigned int entry_statuses4[] = { @@ -189,6 +196,7 @@ static const unsigned int entry_statuses4[] = { GIT_STATUS_WT_DELETED, GIT_STATUS_WT_NEW, GIT_STATUS_WT_NEW, + GIT_STATUS_WT_NEW, }; -static const size_t entry_count4 = 22; +static const size_t entry_count4 = 23; |