Re: [PATCH] git-am: fix detection of absolute paths for windows
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Oct 1, 2010, 17:46 UTC
- Message-ID
- <201010011946.12481.j6t@kdbg.org>
- In-Reply-To
- <87tyl6hnu2.fsf_-_@fox.patthoyts.tk>
On Donnerstag, 30. September 2010, Pat Thoyts wrote:
> 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.
Thanks for tackling this!
Show 7 quoted lines
> @@ -209,5 +209,20 @@ case $(uname -s) in
> find () {
> /usr/bin/find "$@"
> }
> + is_absolute_path () {
> + case "$1" in
> + /* | ?:* | \\\\*)Absolute paths can also start with a backslash, and UNC paths can start with double-slash. Therefore, this should be:
[/\\]* | [A-Za-z]:*)
> + return 0 ;; > + esac > + return 1 > + }
-- Hannes