Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin/write-tree: convert to struct object_id
author
brian m. carlson
<sandals@crustytoothpaste.net>
Mon, 12 Mar 2018 02:27:22 +0000
(
02:27
+0000)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 14 Mar 2018 16:23:47 +0000
(09:23 -0700)
This is needed to convert parts of the cache-tree code.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/write-tree.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
68ee6df
)
diff --git
a/builtin/write-tree.c
b/builtin/write-tree.c
index bd0a78aa3c56b7e817c7ddf6fcaba703d6d5fecc..299a121531c6d54d519d4daa9f52dada1ab84d4c 100644
(file)
--- a/
builtin/write-tree.c
+++ b/
builtin/write-tree.c
@@
-19,7
+19,7
@@
int cmd_write_tree(int argc, const char **argv, const char *unused_prefix)
{
int flags = 0, ret;
const char *prefix = NULL;
{
int flags = 0, ret;
const char *prefix = NULL;
-
unsigned char sha1[20]
;
+
struct object_id oid
;
const char *me = "git-write-tree";
struct option write_tree_options[] = {
OPT_BIT(0, "missing-ok", &flags, N_("allow missing objects"),
const char *me = "git-write-tree";
struct option write_tree_options[] = {
OPT_BIT(0, "missing-ok", &flags, N_("allow missing objects"),
@@
-38,10
+38,10
@@
int cmd_write_tree(int argc, const char **argv, const char *unused_prefix)
argc = parse_options(argc, argv, unused_prefix, write_tree_options,
write_tree_usage, 0);
argc = parse_options(argc, argv, unused_prefix, write_tree_options,
write_tree_usage, 0);
- ret = write_cache_as_tree(
sha1
, flags, prefix);
+ ret = write_cache_as_tree(
oid.hash
, flags, prefix);
switch (ret) {
case 0:
switch (ret) {
case 0:
- printf("%s\n",
sha1_to_hex(sha1
));
+ printf("%s\n",
oid_to_hex(&oid
));
break;
case WRITE_TREE_UNREADABLE_INDEX:
die("%s: error reading the index", me);
break;
case WRITE_TREE_UNREADABLE_INDEX:
die("%s: error reading the index", me);