threads / discuss / 5057

git-checkout doesn't understand -- separator

Subject: git-checkout doesn't understand -- separator

## tl;dr

2 messages between Jul 31, 2006 and Jul 31, 2006.

replies: 1people: 2as markdown or json

Jakub Narebski· Jul 31, 2006, 09:35 UTC · lore

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· Jul 31, 2006, 10:06 UTC · re: Jakub Narebski · lore

Re: git-checkout doesn't understand -- separator

Jakub Narebski <jnareb@gmail.com> writes:
Show 7 quoted lines
> 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

← back to recent threads