From eab0418ffe02910ab461137a01d6926b6600209c Mon Sep 17 00:00:00 2001 From: "tlimoncelli@stackexchange.com" Date: Fri, 3 Jul 2015 11:43:52 -0400 Subject: [PATCH] vcs_relative_path broke on MacOS X. --- bin/_blackbox_common.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/_blackbox_common.sh b/bin/_blackbox_common.sh index fb93f18..66cf2d1 100755 --- a/bin/_blackbox_common.sh +++ b/bin/_blackbox_common.sh @@ -25,6 +25,12 @@ source "${0%/*}"/_stack_lib.sh # Allow overriding gpg command : "${GPG:=gpg}" ; +function physical_directory_of() { + local d=$(dirname "$1") + local f=$(basename "$1") + (cd "$d" && echo $(pwd -P)"/$f" ) +} + # Set REPOBASE to the top of the repository # Set VCS_TYPE to 'git', 'hg', 'svn' or 'unknown' if which >/dev/null 2>/dev/null git && git rev-parse --show-toplevel >/dev/null 2>&1 ; then @@ -52,6 +58,7 @@ else REPOBASE="$(pwd)" fi export VCS_TYPE +export REPOBASE=$(physical_directory_of "$REPOBASE") # FIXME: Verify this function by checking for .hg or .git # after determining what we believe to be the answer.