Johannes Schindelin <[EMAIL PROTECTED]> writes:

>> Question: Do you mind if I push a so regressed mingw.git master, or 
>> would you like that I wait for a fix (that someone among you would have 
>> to provide) that I apply before pushing?
>
> I'd rather have it pushed, and mention it in the ReleaseNotes of (Win-) 
> Git, so that anybody who feels inclined can fix it.

I do not mind a "is_absolute_path" helper function in git-sh-setup.sh,
which msysgit folks can override with their own patch.

        is_absolute_path () {
                case "$1" in
                /*) return 0 ;;
                *) return 1 ;;
                esac
        }

I guess no sane person would name their directory in the work tree as C:
on POSIX systems, so we could even do this cross-platform, but it somehow
makes me feel dirty:

        is_absolute_path () {
                case "$1" in
                /*) return 0 ;;
                [A-Z]:/*) return 0 ;;
                *) return 1 ;;
                esac
        }

In either case, with such a helper, the problematic part would become
something like this:

 git-am.sh |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index 1f6b5e0..0826b09 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -217,12 +217,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

Reply via email to