summaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorPat Thoyts <patthoyts@users.sourceforge.net>2010-09-30 13:24:07 (GMT)
committerPat Thoyts <patthoyts@users.sourceforge.net>2010-10-03 22:31:59 (GMT)
commit5e9677cbdf1840836e22d9cf23198de34877e283 (patch)
tree449c3b8f4b22f197f4ef70ffcda99b302bcb8c7c /git-sh-setup.sh
parent36e035f5dcd214039d5ea96c29de110ae7435137 (diff)
downloadgit-5e9677cbdf1840836e22d9cf23198de34877e283.zip
git-5e9677cbdf1840836e22d9cf23198de34877e283.tar.gz
git-5e9677cbdf1840836e22d9cf23198de34877e283.tar.bz2
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 <j6t@kdbg.org> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Diffstat (limited to 'git-sh-setup.sh')
-rw-r--r--git-sh-setup.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 6131670..58d30c9 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