Skip to content

Commit

Permalink
Use .git/config for storing "origin" shortcut repository
Browse files Browse the repository at this point in the history
Rather than use a separate config .git/remotes/ for remote shortcuts, this
patch adds the analagous definitions to .git/config using git-repo-config
calls.

For example what was previously .git/remotes/origin
  URL: proto://host/path
  Pull: refs/heads/master:refs/heads/origin
Is now added to .git/config as
  [remote "origin"]
  url = proto://host/path
  fetch = refs/heads/master:refs/heads/origin

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Andy Parkins authored and Junio C Hamano committed Nov 28, 2006
1 parent f0df4ed commit 255cae8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions git-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ then
*) origin_track="$remote_top/$origin"
git-update-ref "refs/heads/$origin" "$head_sha1" ;;
esac &&
echo >"$GIT_DIR/remotes/$origin" \
"URL: $repo
Pull: refs/heads/$head_points_at:$origin_track" &&
git-repo-config remote."$origin".url "$repo" &&
git-repo-config remote."$origin".fetch \
"refs/heads/$head_points_at:$origin_track" &&
(cd "$GIT_DIR/$remote_top" && find . -type f -print) |
while read dotslref
do
Expand All @@ -393,8 +393,8 @@ Pull: refs/heads/$head_points_at:$origin_track" &&
then
continue
fi
echo "Pull: refs/heads/${name}:$remote_top/${name}"
done >>"$GIT_DIR/remotes/$origin" &&
git-repo-config remote."$origin".fetch "refs/heads/${name}:$remote_top/${name}" '^$'
done &&
case "$use_separate_remote" in
t)
rm -f "refs/remotes/$origin/HEAD"
Expand Down

0 comments on commit 255cae8

Please sign in to comment.