get_sha1_basic(): corner case ambiguity fix
[gitweb.git] / git-checkout.sh
index 4c08f36b591508b5d940384db603e2f4483116d6..f241d4ba6ba5a988f801e3307022d188204ff572 100755 (executable)
@@ -1,9 +1,7 @@
 #!/bin/sh
-. git-sh-setup || die "Not a git archive"
 
-usage () {
-    die "usage: git checkout [-f] [-b <new_branch>] [<branch>] [<paths>...]"
-}
+USAGE='[-f] [-b <new_branch>] [<branch>] [<paths>...]'
+. git-sh-setup
 
 old=$(git-rev-parse HEAD)
 new=
@@ -82,7 +80,6 @@ then
                # rescuing paths and is never meant to remove what
                # is not in the named tree-ish.
                git-ls-tree -r "$new" "$@" |
-               sed -ne 's/^\([0-7]*\) blob \(.*\)$/\1 \2/p' |
                git-update-index --index-info || exit $?
        fi
        git-checkout-index -f -u -- "$@"