convert: convert convert_to_git to take an index
Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
d6c41c20e6
commit
82b474e025
6
diff.c
6
diff.c
@ -2755,7 +2755,7 @@ static int reuse_worktree_file(const char *name, const unsigned char *sha1, int
|
||||
* Similarly, if we'd have to convert the file contents anyway, that
|
||||
* makes the optimization not worthwhile.
|
||||
*/
|
||||
if (!want_file && would_convert_to_git(name))
|
||||
if (!want_file && would_convert_to_git(&the_index, name))
|
||||
return 0;
|
||||
|
||||
len = strlen(name);
|
||||
@ -2877,7 +2877,7 @@ int diff_populate_filespec(struct diff_filespec *s, unsigned int flags)
|
||||
* point if the path requires us to run the content
|
||||
* conversion.
|
||||
*/
|
||||
if (size_only && !would_convert_to_git(s->path))
|
||||
if (size_only && !would_convert_to_git(&the_index, s->path))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
@ -2904,7 +2904,7 @@ int diff_populate_filespec(struct diff_filespec *s, unsigned int flags)
|
||||
/*
|
||||
* Convert from working tree format to canonical git format
|
||||
*/
|
||||
if (convert_to_git(s->path, s->data, s->size, &buf, crlf_warn)) {
|
||||
if (convert_to_git(&the_index, s->path, s->data, s->size, &buf, crlf_warn)) {
|
||||
size_t size = 0;
|
||||
munmap(s->data, s->size);
|
||||
s->should_munmap = 0;
|
||||
|
Reference in New Issue
Block a user