Use .git/config for storing "origin" shortcut repository
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>
Andy Parkins committed
Nov 26, 2006 at 12:10 UTC
255cae88bcc8fcb0088459df13b55fa3d311b9e2
1 file changed
+5
-5
git-clone.sh
+5
-5
@@ -377,9 +377,9 @@ then
377
*) origin_track="$remote_top/$origin"
378
git-update-ref "refs/heads/$origin" "$head_sha1" ;;
379
esac &&
380
- echo >"$GIT_DIR/remotes/$origin" \
381
- "URL: $repo
382
-Pull: refs/heads/$head_points_at:$origin_track" &&
380
+ git-repo-config remote."$origin".url "$repo" &&
381
+ git-repo-config remote."$origin".fetch \
382
+ "refs/heads/$head_points_at:$origin_track" &&
383
(cd "$GIT_DIR/$remote_top" && find . -type f -print) |
384
while read dotslref
385
do
@@ -393,8 +393,8 @@ Pull: refs/heads/$head_points_at:$origin_track" &&
393
then
394
continue
395
fi
396
- echo "Pull: refs/heads/${name}:$remote_top/${name}"
397
- done >>"$GIT_DIR/remotes/$origin" &&
396
+ git-repo-config remote."$origin".fetch "refs/heads/${name}:$remote_top/${name}" '^$'
397
+ done &&
398
case "$use_separate_remote" in
399
t)
400
rm -f "refs/remotes/$origin/HEAD"