From 5e9677cbdf1840836e22d9cf23198de34877e283 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Thu, 30 Sep 2010 14:24:07 +0100 Subject: git-am: fix detection of absolute paths for windows Add an is_absolute_path function to abstract out platform differences in checking for an absolute or relative path. Specifically fixes t4150-am on Windows. [PT: updated following suggestion from j6t to support \* and //*] Signed-off-by: Johannes Sixt Signed-off-by: Pat Thoyts --- git-sh-setup.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'git-sh-setup.sh') diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 6131670860..58d30c9388 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -209,5 +209,20 @@ case $(uname -s) in find () { /usr/bin/find "$@" } + is_absolute_path () { + case "$1" in + [/\\]* | [A-Za-z]:*) + return 0 ;; + esac + return 1 + } ;; +*) + is_absolute_path () { + case "$1" in + /*) + return 0 ;; + esac + return 1 + } esac -- cgit v1.2.3