From ba41fabe4e8c1ffb5b6ae064089595be64008344 Mon Sep 17 00:00:00 2001 From: Richard Hartmann Date: Mon, 9 Dec 2013 10:18:34 +0100 Subject: [PATCH] Revert "Implement basename in shell" This reverts commit 794f0aac869dda034300211e9be45db123d84377. Conflicts: vcsh Turns out the shell implementation didn't account for trailing slashes. While, arguably, a proper interactive shell should eat them before execution anyway, this can also be called in script context. This means that vcsh clone foo/ made it fail and even after commit 7e33e38a869989d04d12f2ef160d514041eb01e3 vcsh clone foo// would have failed. Revert to safe and time-proven default: Standalone `basename`. For further information, see: https://github.com/RichiH/vcsh/pull/92 --- vcsh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/vcsh b/vcsh index b585f5c..9f8e274 100755 --- a/vcsh +++ b/vcsh @@ -15,15 +15,6 @@ # This should always be the first line of code to facilitate debugging [ -n "$VCSH_DEBUG" ] && set -vx -basename() { - # Implemented in shell to avoid spawning another process - local file - file="${1%/}" - file="${file##*/}" - [ -z "$2" ] || file="${file%$2}" - echo "$file" -} - SELF=$(basename $0) VERSION='1.20130909.git-HEAD' -- 2.39.2