File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1044,7 +1044,7 @@ int remove_path(const char *name)
1044
1044
slash = dirs + (slash - name );
1045
1045
do {
1046
1046
* slash = '\0' ;
1047
- } while (rmdir (dirs ) && (slash = strrchr (dirs , '/' )));
1047
+ } while (rmdir (dirs ) == 0 && (slash = strrchr (dirs , '/' )));
1048
1048
free (dirs );
1049
1049
}
1050
1050
return 0 ;
Original file line number Diff line number Diff line change @@ -271,4 +271,12 @@ test_expect_success 'choking "git rm" should not let it die with cruft' '
271
271
test "$status" != 0
272
272
'
273
273
274
+ test_expect_success ' rm removes subdirectories recursively' '
275
+ mkdir -p dir/subdir/subsubdir &&
276
+ echo content >dir/subdir/subsubdir/file &&
277
+ git add dir/subdir/subsubdir/file &&
278
+ git rm -f dir/subdir/subsubdir/file &&
279
+ ! test -d dir
280
+ '
281
+
274
282
test_done
You can’t perform that action at this time.
0 commit comments