From 5647684bd393e43c71a7dd7f46a25bf3d0e78b1d Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Mon, 5 Apr 2010 14:46:32 +0700 Subject: [PATCH] Fix unmounting repository in case URL contains double slashes and dots --- enter.in | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/enter.in b/enter.in index 1728049..848231b 100644 --- a/enter.in +++ b/enter.in @@ -43,11 +43,8 @@ mounted_repos= unmount_repos() { for _mounted_repo in $mounted_repos; do - - # If current repo directory is actually mounted - if fgrep -q "$_mounted_repo" < /etc/mtab; then - sudo umount "$_mounted_repo" - fi + # Unmount repository no matter what. + sudo umount "$_mounted_repo" 2> /dev/null || : # Remove the repo directory and any empty parent directories sudo rmdir -p "$_mounted_repo" 2> /dev/null || : done