author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 1 Jun 2008 04:28:04 +0000 (00:28 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 1 Jun 2008 06:55:50 +0000 (23:55 -0700) | ||
commit | 7ad2458fadc6cafe25e23affd6cc46cd6494a42d | |
tree | 14b1d0536033afa37713981e9c45977889aa5f3d | tree | snapshot |
parent | c175a7ad32ee978baaa6524304e9406684bd1286 | commit | diff |
Make "git-remote rm" delete refs acccording to fetch specs
A remote may be configured to fetch into tracking branches that
don't match its name. A user may have created a remote by hand
that will fetch to a different tracking branch namespace:
[remote "alt"]
url = git://repo.or.cz/alt-git.git
fetch = refs/heads/*:refs/remotes/origin/*
When deleting remote alt we should clean up the refs whose names
start with "refs/remotes/origin/", even though the remote itself
was named alt by the user.
To avoid deleting refs used by another remote we only clear refs
that are unique to this remote. This prevents `git prune rm alt`
from removing the refs used by say origin if alt was just using a
different URL for the same repository.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
A remote may be configured to fetch into tracking branches that
don't match its name. A user may have created a remote by hand
that will fetch to a different tracking branch namespace:
[remote "alt"]
url = git://repo.or.cz/alt-git.git
fetch = refs/heads/*:refs/remotes/origin/*
When deleting remote alt we should clean up the refs whose names
start with "refs/remotes/origin/", even though the remote itself
was named alt by the user.
To avoid deleting refs used by another remote we only clear refs
that are unique to this remote. This prevents `git prune rm alt`
from removing the refs used by say origin if alt was just using a
different URL for the same repository.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-remote.c | diff | blob | history |