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 @@ -933,7 +933,7 @@ int remove_path(const char *name)
933
933
slash = dirs + (slash - name );
934
934
do {
935
935
* slash = '\0' ;
936
- } while (rmdir (dirs ) && (slash = strrchr (dirs , '/' )));
936
+ } while (rmdir (dirs ) == 0 && (slash = strrchr (dirs , '/' )));
937
937
free (dirs );
938
938
}
939
939
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