projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
git-tar-tree: documentation update
[git.git]
/
builtin-diff.c
diff --git
a/builtin-diff.c
b/builtin-diff.c
index
de81b05
..
6ac3d4b
100644
(file)
--- a/
builtin-diff.c
+++ b/
builtin-diff.c
@@
-233,7
+233,7
@@
static int builtin_diff_combined(struct rev_info *revs,
return 0;
}
return 0;
}
-
static
void add_head(struct rev_info *revs)
+void add_head(struct rev_info *revs)
{
unsigned char sha1[20];
struct object *obj;
{
unsigned char sha1[20];
struct object *obj;
@@
-303,9
+303,9
@@
int cmd_diff(int argc, const char **argv, char **envp)
obj = deref_tag(obj, NULL, 0);
if (!obj)
die("invalid object '%s' given.", name);
obj = deref_tag(obj, NULL, 0);
if (!obj)
die("invalid object '%s' given.", name);
- if (
!strcmp(obj->type, commit_type)
)
+ if (
obj->type == TYPE_COMMIT
)
obj = &((struct commit *)obj)->tree->object;
obj = &((struct commit *)obj)->tree->object;
- if (
!strcmp(obj->type, tree_type)
) {
+ if (
obj->type == TYPE_TREE
) {
if (ARRAY_SIZE(ent) <= ents)
die("more than %d trees given: '%s'",
(int) ARRAY_SIZE(ent), name);
if (ARRAY_SIZE(ent) <= ents)
die("more than %d trees given: '%s'",
(int) ARRAY_SIZE(ent), name);
@@
-315,7
+315,7
@@
int cmd_diff(int argc, const char **argv, char **envp)
ents++;
continue;
}
ents++;
continue;
}
- if (
!strcmp(obj->type, blob_type)
) {
+ if (
obj->type == TYPE_BLOB
) {
if (2 <= blobs)
die("more than two blobs given: '%s'", name);
memcpy(blob[blobs].sha1, obj->sha1, 20);
if (2 <= blobs)
die("more than two blobs given: '%s'", name);
memcpy(blob[blobs].sha1, obj->sha1, 20);