diff options
author | Andy Parkins <andyparkins@gmail.com> | 2006-11-26 12:10:52 +0000 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-11-27 17:08:41 -0800 |
commit | 255cae88bcc8fcb0088459df13b55fa3d311b9e2 (patch) | |
tree | 6feb56e6ba71334ceb69e59a1008ef1bfe2b490e /git-clone.sh | |
parent | f0df4ed5629c25e9978708115ad654b9f83f55df (diff) | |
download | git-255cae88bcc8fcb0088459df13b55fa3d311b9e2.tar.gz |
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>
Diffstat (limited to 'git-clone.sh')
-rwxr-xr-x | git-clone.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/git-clone.sh b/git-clone.sh index d4ee93f75b..b2d0f08e67 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -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 @@ -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" |