aboutsummaryrefslogtreecommitdiffstats
path: root/rev-parse.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-03 13:07:52 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-03 13:07:52 -0700
commit960bba0d8c14c9eb76bbb42eebc39eff58fc452b (patch)
tree11debe811d5fcdc8cc347a4c9aab607bf91fe4cf /rev-parse.c
parentdade09c2269ec2117df085e8a99efcabccf08c53 (diff)
downloadgit-960bba0d8c14c9eb76bbb42eebc39eff58fc452b.tar.gz
Add "--all" flag to rev-parse that shows all refs
And make git-rev-list just silently ignore non-commit refs if we're not asking for all objects.
Diffstat (limited to 'rev-parse.c')
-rw-r--r--rev-parse.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/rev-parse.c b/rev-parse.c
index c134ffda19..c096dc45ee 100644
--- a/rev-parse.c
+++ b/rev-parse.c
@@ -5,6 +5,7 @@
*/
#include "cache.h"
#include "commit.h"
+#include "refs.h"
static char *def = NULL;
static int no_revs = 0;
@@ -46,7 +47,7 @@ static int is_rev_argument(const char *arg)
}
}
-static void show_rev(int type, unsigned char *sha1)
+static void show_rev(int type, const unsigned char *sha1)
{
if (no_revs)
return;
@@ -142,6 +143,12 @@ static void show_default(void)
}
}
+static int show_reference(const char *refname, const unsigned char *sha1)
+{
+ show_rev(NORMAL, sha1);
+ return 0;
+}
+
int main(int argc, char **argv)
{
int i, as_is = 0;
@@ -185,6 +192,10 @@ int main(int argc, char **argv)
show_type ^= REVERSED;
continue;
}
+ if (!strcmp(arg, "--all")) {
+ for_each_ref(show_reference);
+ continue;
+ }
show_arg(arg);
continue;
}