aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-am.sh12
-rw-r--r--git-sh-setup.sh15
2 files changed, 21 insertions, 6 deletions
diff --git a/git-am.sh b/git-am.sh
index e7f008c7b..9317b3893 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -444,12 +444,12 @@ else
set x
first=
}
- case "$arg" in
- /*)
- set "$@" "$arg" ;;
- *)
- set "$@" "$prefix$arg" ;;
- esac
+ if is_absolute_path "$arg"
+ then
+ set "$@" "$arg"
+ else
+ set "$@" "$prefix$arg"
+ fi
done
shift
fi
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 613167086..58d30c938 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