summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 36e035f)
raw | patch | inline | side by side (parent: 36e035f)
author | Pat Thoyts <patthoyts@users.sourceforge.net> | |
Thu, 30 Sep 2010 13:24:07 +0000 (14:24 +0100) | ||
committer | Pat Thoyts <patthoyts@users.sourceforge.net> | |
Sun, 3 Oct 2010 22:31:59 +0000 (23:31 +0100) |
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>
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>
git-am.sh | patch | blob | history | |
git-sh-setup.sh | patch | blob | history |
diff --git a/git-am.sh b/git-am.sh
index e7f008c7baae2ff484e16882e199b6b9d75195aa..9317b3893552fda9d3e4cbdbd0c66bf69bd633a9 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
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 6131670860514c215a6b9b7417dd05c3124e81b4..58d30c9388f14284214fee8ade4603a03e02b3b2 100644 (file)
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
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