Skip to content

Commit dcb47e5

Browse files
newrengitster
authored andcommitted
t6426: fix TODO about making test more comprehensive
t6426.7 (a rename/add testcase) long had a TODO/FIXME comment about how the test could be improved (with some commented out sample code that had a few small errors), but those improvements were blocked on other changes still in progress. The necessary changes were put in place years ago but the comment was forgotten. Remove and fix the commented out code section and finally remove the big TODO/FIXME comment. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c48035d commit dcb47e5

File tree

1 file changed

+23
-35
lines changed

1 file changed

+23
-35
lines changed

t/t6426-merge-skip-unneeded-updates.sh

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -378,42 +378,30 @@ test_expect_success '2c: Modify b & add c VS rename b->c' '
378378
test_i18ngrep "CONFLICT (.*/add):" out &&
379379
test_must_be_empty err &&
380380
381-
# Make sure c WAS updated
381+
git ls-files -s >index_files &&
382+
test_line_count = 2 index_files &&
383+
384+
# Ensure b was removed
385+
test_path_is_missing b &&
386+
387+
# Make sure c WAS updated...
382388
test-tool chmtime --get c >new-mtime &&
383-
test $(cat old-mtime) -lt $(cat new-mtime)
384-
385-
# FIXME: rename/add conflicts are horribly broken right now;
386-
# when I get back to my patch series fixing it and
387-
# rename/rename(2to1) conflicts to bring them in line with
388-
# how add/add conflicts behave, then checks like the below
389-
# could be added. But that patch series is waiting until
390-
# the rename-directory-detection series lands, which this
391-
# is part of. And in the mean time, I do not want to further
392-
# enforce broken behavior. So for now, the main test is the
393-
# one above that err is an empty file.
394-
395-
#git ls-files -s >index_files &&
396-
#test_line_count = 2 index_files &&
397-
398-
#git rev-parse >actual :2:c :3:c &&
399-
#git rev-parse >expect A:b A:c &&
400-
#test_cmp expect actual &&
401-
402-
#git cat-file -p A:b >>merged &&
403-
#git cat-file -p A:c >>merge-me &&
404-
#>empty &&
405-
#test_must_fail git merge-file \
406-
# -L "Temporary merge branch 1" \
407-
# -L "" \
408-
# -L "Temporary merge branch 2" \
409-
# merged empty merge-me &&
410-
#sed -e "s/^\([<=>]\)/\1\1\1/" merged >merged-internal &&
411-
412-
#git hash-object c >actual &&
413-
#git hash-object merged-internal >expect &&
414-
#test_cmp expect actual &&
415-
416-
#test_path_is_missing b
389+
test $(cat old-mtime) -lt $(cat new-mtime) &&
390+
391+
# ...and has correct index entries and working tree contents
392+
git rev-parse >actual :2:c :3:c &&
393+
git rev-parse >expect A:c A:b &&
394+
test_cmp expect actual &&
395+
396+
git cat-file -p A:b >>merge-me &&
397+
git cat-file -p A:c >>merged &&
398+
>empty &&
399+
test_must_fail git merge-file \
400+
-L "HEAD" \
401+
-L "" \
402+
-L "B^0" \
403+
merged empty merge-me &&
404+
test_cmp merged c
417405
)
418406
'
419407

0 commit comments

Comments
 (0)