~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-updates

« back to all changes in this revision

Viewing changes to t/t4001-diff-rename.sh

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-10-04 08:27:01 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20071004082701-rsd058ontoqz4i30
Tags: 1:1.5.3.4-1
new upstream point release (closes: #445188).

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
test_expect_success \
30
30
    'update-cache --add a file.' \
31
 
    'git-update-index --add path0'
 
31
    'git update-index --add path0'
32
32
 
33
33
test_expect_success \
34
34
    'write that tree.' \
35
 
    'tree=$(git-write-tree) && echo $tree'
 
35
    'tree=$(git write-tree) && echo $tree'
36
36
 
37
37
sed -e 's/line/Line/' <path0 >path1
38
38
rm -f path0
39
39
test_expect_success \
40
40
    'renamed and edited the file.' \
41
 
    'git-update-index --add --remove path0 path1'
 
41
    'git update-index --add --remove path0 path1'
42
42
 
43
43
test_expect_success \
44
 
    'git-diff-index -p -M after rename and editing.' \
45
 
    'git-diff-index -p -M $tree >current'
 
44
    'git diff-index -p -M after rename and editing.' \
 
45
    'git diff-index -p -M $tree >current'
46
46
cat >expected <<\EOF
47
47
diff --git a/path0 b/path1
48
48
rename from path0
64
64
    'validate the output.' \
65
65
    'compare_diff_patch current expected'
66
66
 
 
67
test_expect_success 'favour same basenames over different ones' '
 
68
        cp path1 another-path &&
 
69
        git add another-path &&
 
70
        git commit -m 1 &&
 
71
        git rm path1 &&
 
72
        mkdir subdir &&
 
73
        git mv another-path subdir/path1 &&
 
74
        git runstatus | grep "renamed: .*path1 -> subdir/path1"'
 
75
 
 
76
test_expect_success  'favour same basenames even with minor differences' '
 
77
        git show HEAD:path1 | sed "s/15/16/" > subdir/path1 &&
 
78
        git runstatus | grep "renamed: .*path1 -> subdir/path1"'
 
79
 
67
80
test_done