Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diff: convert run_diff_files to struct object_id
author
Brandon Williams
<bmwill@google.com>
Tue, 30 May 2017 17:30:48 +0000
(10:30 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 2 Jun 2017 00:36:07 +0000
(09:36 +0900)
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-lib.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
c26022e
)
diff --git
a/diff-lib.c
b/diff-lib.c
index 7984ff962fd216a20f50ba8970310adf5b2d98d6..c82b07dc1eb47b439bd56f50fb4d07cc8218d22a 100644
(file)
--- a/
diff-lib.c
+++ b/
diff-lib.c
@@
-101,7
+101,7
@@
int run_diff_files(struct rev_info *revs, unsigned int option)
struct cache_entry *ce = active_cache[i];
int changed;
unsigned dirty_submodule = 0;
struct cache_entry *ce = active_cache[i];
int changed;
unsigned dirty_submodule = 0;
- const
unsigned char *old_sha1, *new_sha1
;
+ const
struct object_id *old_oid, *new_oid
;
if (diff_can_quit_early(&revs->diffopt))
break;
if (diff_can_quit_early(&revs->diffopt))
break;
@@
-233,12
+233,12
@@
int run_diff_files(struct rev_info *revs, unsigned int option)
continue;
}
oldmode = ce->ce_mode;
continue;
}
oldmode = ce->ce_mode;
- old_
sha1 = ce->oid.hash
;
- new_
sha1 = changed ? null_sha1 : ce->oid.hash
;
+ old_
oid = &ce->oid
;
+ new_
oid = changed ? &null_oid : &ce->oid
;
diff_change(&revs->diffopt, oldmode, newmode,
diff_change(&revs->diffopt, oldmode, newmode,
- old_
sha1, new_sha1
,
- !is_null_
sha1(old_sha1
),
- !is_null_
sha1(new_sha1
),
+ old_
oid->hash, new_oid->hash
,
+ !is_null_
oid(old_oid
),
+ !is_null_
oid(new_oid
),
ce->name, 0, dirty_submodule);
}
ce->name, 0, dirty_submodule);
}