Code

Allow fetching references from any namespace
authorAlex Riesen <raa.lkml@gmail.com>
Fri, 11 May 2007 20:35:22 +0000 (22:35 +0200)
committerJunio C Hamano <junkio@cox.net>
Sat, 12 May 2007 16:36:06 +0000 (09:36 -0700)
not only from the three defined: heads, tags and remotes.

Noticed when I tried to fetch the references created by git-p4-import.bat:
they are placed into separate namespace (refs/p4import/, to avoid showing
them in git-branch output). As canon_refs_list_for_fetch always prepended
refs/heads/ it was impossible, and annoying: it worked before. Normally,
the p4import references are useless anywhere but in the directory managed
by perforce, but in this special case the cloned directory was supposed
to be a backup, including the p4import branch: it keeps information about
where the imported perforce state came from.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-parse-remote.sh

index 437b0c3b1bc522c4b5a4a3a656b97cb2009c43a0..0506b12cb26966cfaa9eb73f3e1d1a9c5d66cc02 100755 (executable)
@@ -143,13 +143,13 @@ canon_refs_list_for_fetch () {
                fi
                case "$remote" in
                '' | HEAD ) remote=HEAD ;;
-               refs/heads/* | refs/tags/* | refs/remotes/*) ;;
+               refs/*) ;;
                heads/* | tags/* | remotes/* ) remote="refs/$remote" ;;
                *) remote="refs/heads/$remote" ;;
                esac
                case "$local" in
                '') local= ;;
-               refs/heads/* | refs/tags/* | refs/remotes/*) ;;
+               refs/*) ;;
                heads/* | tags/* | remotes/* ) local="refs/$local" ;;
                *) local="refs/heads/$local" ;;
                esac