# git-checkout doesn't understand -- separator

2 messages from 2006-07-31 to 2006-07-31. Participants: Jakub Narebski, Junio C Hamano.
Thread: https://gitlist.dev/t/5057

## Jakub Narebski, 2006-07-31 09:35

Subject: git-checkout doesn't understand -- separator
Message-ID: <eakisg$e6j$1@sea.gmane.org>
URL: https://gitlist.dev/e/eakisg%24e6j%241%40sea.gmane.org

```
git-checkout doesn't understand '--' as a separator between <branch> (which
is optional, but you can always write HEAD), and <path>...

  1144:jnareb@roke:~/git> git checkout HEAD^ -- gitweb/gitweb.cgi
  git-checkout-index: -- is not in the cache

Strange...

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Junio C Hamano, 2006-07-31 10:06

Subject: Re: git-checkout doesn't understand -- separator
Message-ID: <7vvepe6qcu.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vvepe6qcu.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <eakisg$e6j$1@sea.gmane.org>

```
Jakub Narebski <jnareb@gmail.com> writes:

> git-checkout doesn't understand '--' as a separator between <branch> (which
> is optional, but you can always write HEAD), and <path>...
>
>   1144:jnareb@roke:~/git> git checkout HEAD^ -- gitweb/gitweb.cgi
>   git-checkout-index: -- is not in the cache
>
> Strange...

Perhaps...

diff --git a/git-checkout.sh b/git-checkout.sh
index 5613bfc..580a9e8 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -67,6 +67,10 @@ while [ "$#" != "0" ]; do
 			set x "$arg" "$@"
 			shift
 		fi
+		case "$1" in
+		--)
+			shift ;;
+		esac
 		break
 		;;
     esac

```
