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

« back to all changes in this revision

Viewing changes to t/t3700-add.sh

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-04-22 13:31:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20070422133105-xg8fnm18r2cxcbg1
Tags: upstream-1.5.1.2
ImportĀ upstreamĀ versionĀ 1.5.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
test_expect_success \
23
23
        'git-add: Test that executable bit is not used if core.filemode=0' \
24
 
        'git repo-config core.filemode 0 &&
 
24
        'git config core.filemode 0 &&
25
25
         echo foo >xfoo1 &&
26
26
         chmod 755 xfoo1 &&
27
27
         git-add xfoo1 &&
30
30
         *) echo fail; git-ls-files --stage xfoo1; (exit 1);;
31
31
         esac'
32
32
 
 
33
test_expect_success 'git-add: filemode=0 should not get confused by symlink' '
 
34
        rm -f xfoo1 &&
 
35
        ln -s foo xfoo1 &&
 
36
        git-add xfoo1 &&
 
37
        case "`git-ls-files --stage xfoo1`" in
 
38
        120000" "*xfoo1) echo ok;;
 
39
        *) echo fail; git-ls-files --stage xfoo1; (exit 1);;
 
40
        esac
 
41
'
 
42
 
33
43
test_expect_success \
34
44
        'git-update-index --add: Test that executable bit is not used...' \
35
 
        'git repo-config core.filemode 0 &&
 
45
        'git config core.filemode 0 &&
36
46
         echo foo >xfoo2 &&
37
47
         chmod 755 xfoo2 &&
38
48
         git-update-index --add xfoo2 &&
41
51
         *) echo fail; git-ls-files --stage xfoo2; (exit 1);;
42
52
         esac'
43
53
 
 
54
test_expect_success 'git-add: filemode=0 should not get confused by symlink' '
 
55
        rm -f xfoo2 &&
 
56
        ln -s foo xfoo2 &&
 
57
        git update-index --add xfoo2 &&
 
58
        case "`git-ls-files --stage xfoo2`" in
 
59
        120000" "*xfoo2) echo ok;;
 
60
        *) echo fail; git-ls-files --stage xfoo2; (exit 1);;
 
61
        esac
 
62
'
 
63
 
44
64
test_expect_success \
45
65
        'git-update-index --add: Test that executable bit is not used...' \
46
 
        'git repo-config core.filemode 0 &&
 
66
        'git config core.filemode 0 &&
47
67
         ln -s xfoo2 xfoo3 &&
48
68
         git-update-index --add xfoo3 &&
49
69
         case "`git-ls-files --stage xfoo3`" in
51
71
         *) echo fail; git-ls-files --stage xfoo3; (exit 1);;
52
72
         esac'
53
73
 
 
74
test_expect_success '.gitignore test setup' '
 
75
        echo "*.ig" >.gitignore &&
 
76
        mkdir c.if d.ig &&
 
77
        >a.ig && >b.if &&
 
78
        >c.if/c.if && >c.if/c.ig &&
 
79
        >d.ig/d.if && >d.ig/d.ig
 
80
'
 
81
 
 
82
test_expect_success '.gitignore is honored' '
 
83
        git-add . &&
 
84
        ! git-ls-files | grep "\\.ig"
 
85
'
 
86
 
 
87
test_expect_success 'error out when attempting to add ignored ones without -f' '
 
88
        ! git-add a.?? &&
 
89
        ! git-ls-files | grep "\\.ig"
 
90
'
 
91
 
 
92
test_expect_success 'error out when attempting to add ignored ones without -f' '
 
93
        ! git-add d.?? &&
 
94
        ! git-ls-files | grep "\\.ig"
 
95
'
 
96
 
 
97
test_expect_success 'add ignored ones with -f' '
 
98
        git-add -f a.?? &&
 
99
        git-ls-files --error-unmatch a.ig
 
100
'
 
101
 
 
102
test_expect_success 'add ignored ones with -f' '
 
103
        git-add -f d.??/* &&
 
104
        git-ls-files --error-unmatch d.ig/d.if d.ig/d.ig
 
105
'
 
106
 
54
107
test_done