Skip to content

Commit 96f12b5

Browse files
raalkmlJunio C Hamano
authored andcommitted
Allow fetching references from any namespace
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a6e3768 commit 96f12b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-parse-remote.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ canon_refs_list_for_fetch () {
143143
fi
144144
case "$remote" in
145145
'' | HEAD ) remote=HEAD ;;
146-
refs/heads/* | refs/tags/* | refs/remotes/*) ;;
146+
refs/*) ;;
147147
heads/* | tags/* | remotes/* ) remote="refs/$remote" ;;
148148
*) remote="refs/heads/$remote" ;;
149149
esac
150150
case "$local" in
151151
'') local= ;;
152-
refs/heads/* | refs/tags/* | refs/remotes/*) ;;
152+
refs/*) ;;
153153
heads/* | tags/* | remotes/* ) local="refs/$local" ;;
154154
*) local="refs/heads/$local" ;;
155155
esac

0 commit comments

Comments
 (0)