{"thread":{"id":"2048","subject":"[PATCH Cogito] cg-fetch: fix local cloning with symbolic refs","startedAt":"2005-10-08T17:48:57Z","lastAt":"2005-10-08T17:48:57Z","messageCount":1,"participants":["Jonas Fonseca"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"9837","messageId":"20051008174857.GB28875@diku.dk","threadId":"2048","inReplyTo":null,"subject":"[PATCH Cogito] cg-fetch: fix local cloning with symbolic refs","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2005-10-08T17:48:57Z","receivedAt":"2005-10-08T17:48:57Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Ugly workaround for making the HEAD getter use 'git-symbolic-ref HEAD'\nso that git-local-fetch is passed the proper ID and not 'ref: ...'.\n\n---\n\nYeah, it is ugly, it assumes we are getting the HEAD (which is currently\nthe only one using the -b flag.\n\ndiff --git a/cg-fetch b/cg-fetch\nindex d0d37e1..57096cd 100755\n--- a/cg-fetch\n+++ b/cg-fetch\n@@ -248,9 +248,10 @@ fetch_ssh()\n \n get_local()\n {\n+\tsymref=\n \tcp_flags_l=\"-vdpR\"\n \tif [ \"$1\" = \"-b\" ]; then\n-\t\tcp_flags_l=\"-vb\" # Dereference symlinks\n+\t\tsymref=1\n \t\tshift\n \tfi\n \n@@ -270,6 +271,7 @@ get_local()\n \n \tsrc=\"$1\"\n \tdest=\"$2\"\n+\t[ \"$symref\" ] && src=\"$(dirname $src)/$(git-symbolic-ref HEAD)\"\n \t[ \"$cut_last\" ] && dest=${dest%/*}\n \n \tcp $cp_flags_l \"$src\" \"$dest\"\n\n-- \nJonas Fonseca\n"}]}