git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Cloning from a repo without "current branch"

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 17, 2007, 03:41 UTC
Message-ID
<7vbqff1c3w.fsf@assigned-by-dhcp.pobox.com>
In-Reply-To
<200706162226.l5GMQBss004492@mi0.bluebottle.com>
Nanako Shiraishi <nanako3@bluebottle.com> writes:
Show 19 quoted lines
> diff --git a/git-clone.sh b/git-clone.sh
> index 3a41062..bd44ce1 100755
> --- a/git-clone.sh
> +++ b/git-clone.sh
> @@ -377,6 +377,13 @@ then
>  		)
>  	)
>  
> +	# Upstream URL
> +	git-config remote."$origin".url "$repo" &&
> +
> +	# Set up the mappings to track the remote branches.
> +	git-config remote."$origin".fetch \
> +		"+refs/heads/*:$remote_top/*" '^$' &&
> +
>  	# Write out remote.$origin config, and update our
> "$head_points_at".
>  	case "$head_points_at" in
>  	?*)
Whitespace breakage?
Show 21 quoted lines
> @@ -384,21 +391,20 @@ then
>  		git-symbolic-ref HEAD "refs/heads/$head_points_at" &&
>  
>  		# Tracking branch for the primary branch at the remote.
> -		origin_track="$remote_top/$head_points_at" &&
>  		git-update-ref HEAD "$head_sha1" &&
>  
> -		# Upstream URL
> -		git-config remote."$origin".url "$repo" &&
> -
> -		# Set up the mappings to track the remote branches.
> -		git-config remote."$origin".fetch \
> -			"+refs/heads/*:$remote_top/*" '^$' &&
>  		rm -f "refs/remotes/$origin/HEAD"
>  		git-symbolic-ref "refs/remotes/$origin/HEAD" \
>  			"refs/remotes/$origin/$head_points_at" &&
>  
>  		git-config branch."$head_points_at".remote "$origin" &&
>  		git-config branch."$head_points_at".merge
> "refs/heads/$head_points_at"
> +		;;
Again...?
Show 10 quoted lines
> +	'')
> +		# Source had detached HEAD pointing nowhere
> +		git-update-ref --no-deref HEAD "$head_sha1" &&
> +		rm -f "refs/remotes/$origin/HEAD"
> +		;;
>  	esac
>  
>  	case "$no_checkout" in
> -- 
> 1.5.2
Previous: Nanako ShiraishiNext: Nanako Shiraishi
Message 2 of 8 in “Cloning from a repo without "current branch"”
  1. Cloning from a repo without "current branch"Nanako Shiraishi, Jun 16, 2007
  2. Junio C HamanoJun 17, 2007
  3. Nanako ShiraishiJun 20, 2007
  4. Junio C HamanoJun 20, 2007
  5. Shawn O. PearceJun 21, 2007
  6. Linus TorvaldsJun 21, 2007
  7. Linus TorvaldsJun 21, 2007
  8. Shawn O. PearceJun 22, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.