Skip to content

Commit

Permalink
Fix various issues found in comments
Browse files Browse the repository at this point in the history
A random hodge-podge of incorrect or out-of-date comments that I found:

  * t6423 had a comment that has referred to the wrong test for years;
    fix it to refer to the right one.
  * diffcore-rename had a FIXME comment meant to remind myself to
    investigate if I could make another code change.  I later
    investigated and removed the FIXME, but while cherry-picking the
    patch to submit upstream I missed the later update.  Remove the
    comment now.
  * merge-ort had the early part of a comment for a function; I had
    meant to include the more involved description when I updated the
    function.  Update the comment now.

Signed-off-by: Elijah Newren <newren@gmail.com>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
newren authored and gitster committed Jun 9, 2021
1 parent 61bf449 commit 356da0f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion diffcore-rename.c
Expand Up @@ -1544,7 +1544,7 @@ void diffcore_rename_extended(struct diff_options *options,
/* all the usual ones need to be kept */
diff_q(&outq, p);
else
/* no need to keep unmodified pairs; FIXME: remove earlier? */
/* no need to keep unmodified pairs */
pair_to_free = p;

if (pair_to_free)
Expand Down
8 changes: 5 additions & 3 deletions merge-ort.c
Expand Up @@ -2533,7 +2533,7 @@ static int compare_pairs(const void *a_, const void *b_)
return strcmp(a->one->path, b->one->path);
}

/* Call diffcore_rename() to compute which files have changed on given side */
/* Call diffcore_rename() to update deleted/added pairs into rename pairs */
static void detect_regular_renames(struct merge_options *opt,
unsigned side_index)
{
Expand Down Expand Up @@ -2586,8 +2586,10 @@ static void detect_regular_renames(struct merge_options *opt,
}

/*
* Get information of all renames which occurred in 'side_pairs', discarding
* non-renames.
* Get information of all renames which occurred in 'side_pairs', making use
* of any implicit directory renames in side_dir_renames (also making use of
* implicit directory renames rename_exclusions as needed by
* check_for_directory_rename()). Add all (updated) renames into result.
*/
static int collect_renames(struct merge_options *opt,
struct diff_queue_struct *result,
Expand Down
2 changes: 1 addition & 1 deletion t/t6423-merge-rename-directories.sh
Expand Up @@ -454,7 +454,7 @@ test_expect_success '1f: Split a directory into two other directories' '
# the directory renamed, but the files within it. (see 1b)
#
# If renames split a directory into two or more others, the directory
# with the most renames, "wins" (see 1c). However, see the testcases
# with the most renames, "wins" (see 1f). However, see the testcases
# in section 2, plus testcases 3a and 4a.
###########################################################################

Expand Down

0 comments on commit 356da0f

Please sign in to comment.