archimport: allow for old style branch and public tag names
[git.git] / git-fetch.sh
index 31b1cf0..8564cbf 100755 (executable)
@@ -114,7 +114,12 @@ fast_forward_local () {
        # is no way to guarantee "fast-forward" anyway.
        if test -f "$GIT_DIR/$1"
        then
-               echo >&2 "* $1: updating with $3"
+               if now_=$(cat "$GIT_DIR/$1") && test "$now_" = "$2"
+               then
+                       echo >&2 "* $1: same as $3"
+               else
+                       echo >&2 "* $1: updating with $3"
+               fi
        else
                echo >&2 "* $1: storing $3"
        fi
@@ -225,7 +230,7 @@ do
            $u =~ s{([^-a-zA-Z0-9/.])}{sprintf"%%%02x",ord($1)}eg;
            print "$u";
        ' "$remote_name")
-       head=$(curl -nsf $curl_extra_args "$remote/$remote_name_quoted") &&
+       head=$(curl -nsfL $curl_extra_args "$remote/$remote_name_quoted") &&
        expr "$head" : "$_x40\$" >/dev/null ||
                die "Failed to fetch $remote_name from $remote"
        echo >&2 Fetching "$remote_name from $remote" using http