2 * Copyright (C) 2008 Shawn Pearce <spearce@spearce.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License, version 2, as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
17 package org
.spearce
.jgit
.pgm
;
19 import java
.util
.TreeMap
;
21 import org
.spearce
.jgit
.lib
.AnyObjectId
;
22 import org
.spearce
.jgit
.lib
.Ref
;
24 class ShowRef
extends TextBuiltin
{
26 void execute(String
[] args
) throws Exception
{
27 for (final Ref r
: new TreeMap
<String
, Ref
>(db
.getAllRefs()).values()) {
28 show(r
.getObjectId(), r
.getName());
29 if (r
.getPeeledObjectId() != null)
30 show(r
.getPeeledObjectId(), r
.getName() + "^{}");
34 private void show(final AnyObjectId id
, final String name
) {