Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jk/maint-rmdir-fix' into maint-1.6.6
author
Junio C Hamano
<gitster@pobox.com>
Sun, 7 Mar 2010 22:53:50 +0000
(14:53 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Sun, 7 Mar 2010 22:53:50 +0000
(14:53 -0800)
* jk/maint-rmdir-fix:
rm: fix bug in recursive subdirectory removal
dir.c
patch
|
blob
|
history
t/t3600-rm.sh
patch
|
blob
|
history
raw
(from parent 1:
11a1a49
)
diff --git
a/dir.c
b/dir.c
index d0999ba055367c31571b251fb34bb46ed6c7051d..5d0a3084dbe1e7a23f7863f6c206914fbbfc0bf6 100644
(file)
--- a/
dir.c
+++ b/
dir.c
@@
-933,7
+933,7
@@
int remove_path(const char *name)
slash = dirs + (slash - name);
do {
*slash = '\0';
- } while (rmdir(dirs) && (slash = strrchr(dirs, '/')));
+ } while (rmdir(dirs)
== 0
&& (slash = strrchr(dirs, '/')));
free(dirs);
}
return 0;
diff --git
a/t/t3600-rm.sh
b/t/t3600-rm.sh
index 76b1bb45456a18a8c1c33256695396cc2b65a3a9..0aaf0ad84b05e1ee17e9789811ea06f2d2798556 100755
(executable)
--- a/
t/t3600-rm.sh
+++ b/
t/t3600-rm.sh
@@
-271,4
+271,12
@@
test_expect_success 'choking "git rm" should not let it die with cruft' '
test "$status" != 0
'
+test_expect_success 'rm removes subdirectories recursively' '
+ mkdir -p dir/subdir/subsubdir &&
+ echo content >dir/subdir/subsubdir/file &&
+ git add dir/subdir/subsubdir/file &&
+ git rm -f dir/subdir/subsubdir/file &&
+ ! test -d dir
+'
+
test_done