@@ -19,33 +19,42 @@ begin_test "pull"
1919 contents_oid=$( calc_oid " $contents " )
2020 contents2=" A"
2121 contents2_oid=$( calc_oid " $contents2 " )
22+ contents3=" dir"
23+ contents3_oid=$( calc_oid " $contents3 " )
2224
25+ mkdir dir
26+ echo " *.log" > .gitignore
2327 printf " $contents " > a.dat
2428 printf " $contents2 " > á.dat
25- git add a.dat á.dat .gitattributes
29+ printf " $contents3 " > dir/dir.dat
30+ git add .
2631 git commit -m " add files" 2>&1 | tee commit.log
2732 grep " master (root-commit)" commit.log
28- grep " 3 files changed" commit.log
33+ grep " 5 files changed" commit.log
2934 grep " create mode 100644 a.dat" commit.log
3035 grep " create mode 100644 .gitattributes" commit.log
3136
3237 ls -al
3338 [ " a" = " $( cat a.dat) " ]
3439 [ " A" = " $( cat " á.dat" ) " ]
40+ [ " dir" = " $( cat " dir/dir.dat" ) " ]
3541
3642 assert_pointer " master" " a.dat" " $contents_oid " 1
3743 assert_pointer " master" " á.dat" " $contents2_oid " 1
44+ assert_pointer " master" " dir/dir.dat" " $contents3_oid " 3
3845
3946 refute_server_object " $reponame " " $contents_oid "
4047 refute_server_object " $reponame " " $contents2_oid "
48+ refute_server_object " $reponame " " $contents33oid "
4149
4250 echo " initial push"
4351 git push origin master 2>&1 | tee push.log
44- grep " (2 of 2 files)" push.log
52+ grep " (3 of 3 files)" push.log
4553 grep " master -> master" push.log
4654
4755 assert_server_object " $reponame " " $contents_oid "
4856 assert_server_object " $reponame " " $contents2_oid "
57+ assert_server_object " $reponame " " $contents3_oid "
4958
5059 # change to the clone's working directory
5160 cd ../clone
@@ -58,21 +67,22 @@ begin_test "pull"
5867
5968 assert_local_object " $contents_oid " 1
6069 assert_local_object " $contents2_oid " 1
70+ assert_clean_status
6171
6272 echo " lfs pull"
63- rm a.dat á.dat
73+ rm -r a.dat á.dat dir # removing files makes the status dirty
6474 rm -rf .git/lfs/objects
65- git lfs pull 2>&1 | grep " (2 of 2 files)"
75+ git lfs pull 2>&1 | grep " (3 of 3 files)"
6676 ls -al
6777 [ " a" = " $( cat a.dat) " ]
6878 [ " A" = " $( cat " á.dat" ) " ]
6979 assert_local_object " $contents_oid " 1
7080 assert_local_object " $contents2_oid " 1
7181
7282 echo " lfs pull with remote"
73- rm a.dat á.dat
83+ rm -r a.dat á.dat dir
7484 rm -rf .git/lfs/objects
75- git lfs pull origin 2>&1 | grep " (2 of 2 files)"
85+ git lfs pull origin 2>&1 | grep " (3 of 3 files)"
7686 [ " a" = " $( cat a.dat) " ]
7787 [ " A" = " $( cat " á.dat" ) " ]
7888 assert_local_object " $contents_oid " 1
@@ -105,6 +115,27 @@ begin_test "pull"
105115 rm -rf .git/lfs/objects
106116 git lfs pull --exclude=" a*"
107117 refute_local_object " $contents_oid "
118+
119+ echo " resetting to test status"
120+ git reset --hard
121+ assert_clean_status
122+
123+ echo " lfs pull clean status"
124+ git lfs pull
125+ assert_clean_status
126+
127+ echo " lfs pull with -I"
128+ git lfs pull -I " *.dat"
129+ assert_clean_status
130+
131+ echo " lfs pull in subdir"
132+ cd dir
133+ git lfs pull
134+ assert_clean_status
135+
136+ echo " lfs pull in subdir with -I"
137+ git lfs pull -I " *.dat"
138+ assert_clean_status
108139)
109140end_test
110141
0 commit comments