summaryrefslogtreecommitdiff
path: root/builtin-remote.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-03-19 00:27:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-03-20 00:33:30 (GMT)
commit740fdd27f0888d5c80ef6a550734bdc53febd2df (patch)
tree756cad7b6c49779627d2a08f4e1140835ab82643 /builtin-remote.c
parenta811e4f0f023d88596adbf39674a18d34b2f152d (diff)
downloadgit-740fdd27f0888d5c80ef6a550734bdc53febd2df.zip
git-740fdd27f0888d5c80ef6a550734bdc53febd2df.tar.gz
git-740fdd27f0888d5c80ef6a550734bdc53febd2df.tar.bz2
remote show: do not show symbolic refs
For symbolic refs, a sane notion of being "stale" is that the ref they point to no longer exists. Since this is checked already, "remote show" does not need to show them at all. Incidentally, this fixes the issue that "HEAD" was shown as a stale ref by "remote show" in a freshly cloned repository. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-remote.c')
-rw-r--r--builtin-remote.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin-remote.c b/builtin-remote.c
index 24e6929..9c15173 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -207,7 +207,10 @@ static int handle_one_branch(const char *refname,
if (!remote_find_tracking(states->remote, &refspec)) {
struct path_list_item *item;
const char *name = skip_prefix(refspec.src, "refs/heads/");
- if (unsorted_path_list_has_path(&states->tracked, name) ||
+ /* symbolic refs pointing nowhere were handled already */
+ if ((flags & REF_ISSYMREF) ||
+ unsorted_path_list_has_path(&states->tracked,
+ name) ||
unsorted_path_list_has_path(&states->new,
name))
return 0;