Merge branch 'ab/test-cleanly-recreate-trash-directory'
Improve test framework around unwritable directories. * ab/test-cleanly-recreate-trash-directory: test-lib.sh: try to re-chmod & retry on failed trash removal
This commit is contained in:
@ -1407,8 +1407,20 @@ HOME="$TRASH_DIRECTORY"
|
|||||||
GNUPGHOME="$HOME/gnupg-home-not-used"
|
GNUPGHOME="$HOME/gnupg-home-not-used"
|
||||||
export HOME GNUPGHOME USER_HOME
|
export HOME GNUPGHOME USER_HOME
|
||||||
|
|
||||||
|
# "rm -rf" existing trash directory, even if a previous run left it
|
||||||
|
# with bad permissions.
|
||||||
|
remove_trash_directory () {
|
||||||
|
dir="$1"
|
||||||
|
if ! rm -rf "$dir" 2>/dev/null
|
||||||
|
then
|
||||||
|
chmod -R u+rwx "$dir"
|
||||||
|
rm -rf "$dir"
|
||||||
|
fi
|
||||||
|
! test -d "$dir"
|
||||||
|
}
|
||||||
|
|
||||||
# Test repository
|
# Test repository
|
||||||
rm -fr "$TRASH_DIRECTORY" || {
|
remove_trash_directory "$TRASH_DIRECTORY" || {
|
||||||
GIT_EXIT_OK=t
|
GIT_EXIT_OK=t
|
||||||
echo >&5 "FATAL: Cannot prepare test area"
|
echo >&5 "FATAL: Cannot prepare test area"
|
||||||
exit 1
|
exit 1
|
||||||
|
Reference in New Issue
Block a user