From 72435c1a73babf3172a9d81a60dd1a03172f7865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 13 Jul 2010 17:26:36 +0200 Subject: [PATCH] Interact with VCS directly when checking whole directory removal. Use VCS functions to check whether the cached/to-be-committed version of the working tree contains the particular directory instead of using the local working tree. Thanks to that, the functions no longer care about stray files. --- sunrise-commit | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sunrise-commit b/sunrise-commit index 77281e9..b1f1484 100755 --- a/sunrise-commit +++ b/sunrise-commit @@ -69,11 +69,9 @@ find_repo() { # from the repo. is_whole_dir_removed() { if [ ${SC_VCS} = svn ]; then - local flist - flist=$(find "${1}" \( -name '.svn' -prune -o ! -name "${1}" -print \)) - [ -z "${flist}" ] + [ -z "$(svn status --depth=empty -- "${1}")" ] elif [ ${SC_VCS%-svn} = git ]; then - [ ! -e "${1}" ] + [ -z "$(git ls-files -c -- "${1}")" ] fi }