summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dade09c)
raw | patch | inline | side by side (parent: dade09c)
author | Linus Torvalds <torvalds@g5.osdl.org> | |
Sun, 3 Jul 2005 20:07:52 +0000 (13:07 -0700) | ||
committer | Linus Torvalds <torvalds@g5.osdl.org> | |
Sun, 3 Jul 2005 20:07:52 +0000 (13:07 -0700) |
And make git-rev-list just silently ignore non-commit refs if we're not
asking for all objects.
asking for all objects.
rev-list.c | patch | blob | history | |
rev-parse.c | patch | blob | history |
diff --git a/rev-list.c b/rev-list.c
index fb75c22bc7c88741758069977afb706f44758cdc..abb611f8b50a97b96981bec606a2eb85b8888596 100644 (file)
--- a/rev-list.c
+++ b/rev-list.c
@@ -377,7 +377,7 @@ static struct commit *get_commit_reference(const char *name, unsigned int flags)
if (object->type == tree_type) {
struct tree *tree = (struct tree *)object;
if (!tree_objects)
- die("%s is a tree object, not a commit", name);
+ return NULL;
if (flags & UNINTERESTING) {
mark_tree_uninteresting(tree);
return NULL;
@@ -392,7 +392,7 @@ static struct commit *get_commit_reference(const char *name, unsigned int flags)
if (object->type == blob_type) {
struct blob *blob = (struct blob *)object;
if (!blob_objects)
- die("%s is a blob object, not a commit", name);
+ return NULL;
if (flags & UNINTERESTING) {
mark_blob_uninteresting(blob);
return NULL;
diff --git a/rev-parse.c b/rev-parse.c
index c134ffda1913082e3b38c6bee7acd3747d633ffd..c096dc45ee7606c2b2947400f66c350f5801cb06 100644 (file)
--- a/rev-parse.c
+++ b/rev-parse.c
*/
#include "cache.h"
#include "commit.h"
+#include "refs.h"
static char *def = NULL;
static int no_revs = 0;
}
}
-static void show_rev(int type, unsigned char *sha1)
+static void show_rev(int type, const unsigned char *sha1)
{
if (no_revs)
return;
}
}
+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;
show_type ^= REVERSED;
continue;
}
+ if (!strcmp(arg, "--all")) {
+ for_each_ref(show_reference);
+ continue;
+ }
show_arg(arg);
continue;
}