projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Shrink "struct object" a bit
[git.git]
/
describe.c
diff --git
a/describe.c
b/describe.c
index
ff65742
..
aa3434a
100644
(file)
--- a/
describe.c
+++ b/
describe.c
@@
-67,7
+67,7
@@
static int get_name(const char *path, const unsigned char *sha1)
* Otherwise only annotated tags are used.
*/
if (!strncmp(path, "refs/tags/", 10)) {
* Otherwise only annotated tags are used.
*/
if (!strncmp(path, "refs/tags/", 10)) {
- if (object->type ==
tag_type
)
+ if (object->type ==
TYPE_TAG
)
prio = 2;
else
prio = 1;
prio = 2;
else
prio = 1;
@@
-105,11
+105,11
@@
static void describe(char *arg, int last_one)
static int initialized = 0;
struct commit_name *n;
static int initialized = 0;
struct commit_name *n;
- if (get_sha1(arg, sha1)
< 0
)
-
usage(describe_usage
);
+ if (get_sha1(arg, sha1))
+
die("Not a valid object name %s", arg
);
cmit = lookup_commit_reference(sha1);
if (!cmit)
cmit = lookup_commit_reference(sha1);
if (!cmit)
-
usage(describe_usag
e);
+
die("%s is not a valid '%s' object", arg, commit_typ
e);
if (!initialized) {
initialized = 1;
if (!initialized) {
initialized = 1;