Code

git-clone: honor "--" to end argument parsing
authorHeikki Orsila <heikki.orsila@iki.fi>
Thu, 1 Nov 2007 14:21:39 +0000 (16:21 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 4 Nov 2007 04:44:13 +0000 (21:44 -0700)
Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Documentation/git-clone.txt
git-clone.sh

index cca14d6b5df042fcf48889e5ff00285ffc4c3009..14e58f3866e3a4e7d1da01753cb68082e88ae2f6 100644 (file)
@@ -12,7 +12,7 @@ SYNOPSIS
 'git-clone' [--template=<template_directory>]
          [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare]
          [-o <name>] [-u <upload-pack>] [--reference <repository>]
-         [--depth <depth>] <repository> [<directory>]
+         [--depth <depth>] [--] <repository> [<directory>]
 
 DESCRIPTION
 -----------
index 0ea3c24f59e32055e4d514e55fe3a6f6be095f9c..3f006936085cedcdca436455643b05d2198e3606 100755 (executable)
@@ -14,7 +14,7 @@ die() {
 }
 
 usage() {
-       die "Usage: $0 [--template=<template_directory>] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [--depth <n>] [-n] <repo> [<dir>]"
+       die "Usage: $0 [--template=<template_directory>] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [--depth <n>] [-n] [--] <repo> [<dir>]"
 }
 
 get_repo_base() {
@@ -160,6 +160,9 @@ while
        *,--depth)
                shift
                depth="--depth=$1";;
+       *,--)
+               shift
+               break ;;
        *,-*) usage ;;
        *) break ;;
        esac