Skip to content

Commit be02033

Browse files
Junio C HamanoLinus Torvalds
authored andcommitted
[PATCH] Remove a function not used anymore.
Earlier rename/copy detection left unmodified filepair in the output and forced downstream to keep them even when they are filtering, and the diff_needs_to_stay() function was used for the logic. It is not used anymore, so remove it. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 19feebc commit be02033

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

diff.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -647,28 +647,6 @@ static void diff_flush_patch(struct diff_filepair *p)
647647
run_diff(name, other, p->one, p->two, msg);
648648
}
649649

650-
int diff_needs_to_stay(struct diff_queue_struct *q, int i,
651-
struct diff_filespec *it)
652-
{
653-
/* If it will be used in later entry (either stay or used
654-
* as the source of rename/copy), we need to copy, not rename.
655-
*/
656-
while (i < q->nr) {
657-
struct diff_filepair *p = q->queue[i++];
658-
if (!DIFF_FILE_VALID(p->two))
659-
continue; /* removed is fine */
660-
if (strcmp(p->one->path, it->path))
661-
continue; /* not relevant */
662-
663-
/* p has its src set to *it and it is not a delete;
664-
* it will be used for in-place change, rename/copy,
665-
* or just stays there. We cannot rename it out.
666-
*/
667-
return 1;
668-
}
669-
return 0;
670-
}
671-
672650
int diff_queue_is_empty(void)
673651
{
674652
struct diff_queue_struct *q = &diff_queued_diff;

diffcore.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ extern struct diff_filepair *diff_queue(struct diff_queue_struct *,
7070
struct diff_filespec *);
7171
extern void diff_q(struct diff_queue_struct *, struct diff_filepair *);
7272

73-
extern int diff_needs_to_stay(struct diff_queue_struct *, int,
74-
struct diff_filespec *);
75-
7673
#define DIFF_DEBUG 0
7774
#if DIFF_DEBUG
7875
void diff_debug_filespec(struct diff_filespec *, int, const char *);

0 commit comments

Comments
 (0)