mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
Support case folding in git fast-import when core.ignorecase=true
When core.ignorecase=true, imported file paths will be folded to match existing directory case. Signed-off-by: Joshua Jensen <jjensen@workspacewhiz.com> Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
dc1ae70487
commit
50906e04e8
|
@ -156,6 +156,7 @@ Format of STDIN stream:
|
||||||
#include "csum-file.h"
|
#include "csum-file.h"
|
||||||
#include "quote.h"
|
#include "quote.h"
|
||||||
#include "exec_cmd.h"
|
#include "exec_cmd.h"
|
||||||
|
#include "dir.h"
|
||||||
|
|
||||||
#define PACK_ID_BITS 16
|
#define PACK_ID_BITS 16
|
||||||
#define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
|
#define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
|
||||||
|
@ -1461,7 +1462,7 @@ static int tree_content_set(
|
||||||
|
|
||||||
for (i = 0; i < t->entry_count; i++) {
|
for (i = 0; i < t->entry_count; i++) {
|
||||||
e = t->entries[i];
|
e = t->entries[i];
|
||||||
if (e->name->str_len == n && !strncmp(p, e->name->str_dat, n)) {
|
if (e->name->str_len == n && !strncmp_icase(p, e->name->str_dat, n)) {
|
||||||
if (!slash1) {
|
if (!slash1) {
|
||||||
if (!S_ISDIR(mode)
|
if (!S_ISDIR(mode)
|
||||||
&& e->versions[1].mode == mode
|
&& e->versions[1].mode == mode
|
||||||
|
@ -1527,7 +1528,7 @@ static int tree_content_remove(
|
||||||
|
|
||||||
for (i = 0; i < t->entry_count; i++) {
|
for (i = 0; i < t->entry_count; i++) {
|
||||||
e = t->entries[i];
|
e = t->entries[i];
|
||||||
if (e->name->str_len == n && !strncmp(p, e->name->str_dat, n)) {
|
if (e->name->str_len == n && !strncmp_icase(p, e->name->str_dat, n)) {
|
||||||
if (!slash1 || !S_ISDIR(e->versions[1].mode))
|
if (!slash1 || !S_ISDIR(e->versions[1].mode))
|
||||||
goto del_entry;
|
goto del_entry;
|
||||||
if (!e->tree)
|
if (!e->tree)
|
||||||
|
@ -1577,7 +1578,7 @@ static int tree_content_get(
|
||||||
|
|
||||||
for (i = 0; i < t->entry_count; i++) {
|
for (i = 0; i < t->entry_count; i++) {
|
||||||
e = t->entries[i];
|
e = t->entries[i];
|
||||||
if (e->name->str_len == n && !strncmp(p, e->name->str_dat, n)) {
|
if (e->name->str_len == n && !strncmp_icase(p, e->name->str_dat, n)) {
|
||||||
if (!slash1) {
|
if (!slash1) {
|
||||||
memcpy(leaf, e, sizeof(*leaf));
|
memcpy(leaf, e, sizeof(*leaf));
|
||||||
if (e->tree && is_null_sha1(e->versions[1].sha1))
|
if (e->tree && is_null_sha1(e->versions[1].sha1))
|
||||||
|
|
Loading…
Reference in a new issue