Put struct expand_data into global scope to reuse it
in cat-file.

Signed-off-by: Olga Telezhnaia <olyatelezhn...@gmail.com>
---
 builtin/cat-file.c | 15 ---------------
 ref-filter.c       | 11 +----------
 ref-filter.h       | 12 ++++++++++++
 3 files changed, 13 insertions(+), 25 deletions(-)

diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index e52646c0e6b5b..edf45f078b919 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -193,21 +193,6 @@ static int cat_one_file(int opt, const char *exp_type, 
const char *obj_name,
        return 0;
 }
 
-struct expand_data {
-       struct object_id oid;
-       enum object_type type;
-       unsigned long size;
-       off_t disk_size;
-       struct object_id delta_base_oid;
-
-       /*
-        * After a mark_query run, this object_info is set up to be
-        * passed to oid_object_info_extended. It will point to the data
-        * elements above, so you can retrieve the response from there.
-        */
-       struct object_info info;
-};
-
 static int is_atom(const char *atom, const char *s, int slen)
 {
        int alen = strlen(atom);
diff --git a/ref-filter.c b/ref-filter.c
index 46bf89b3330de..65b94ea21e54f 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -64,16 +64,7 @@ struct refname_atom {
        int lstrip, rstrip;
 };
 
-static struct expand_data {
-       struct object_id oid;
-       enum object_type type;
-       unsigned long size;
-       off_t disk_size;
-       struct object_id delta_base_oid;
-       void *content;
-
-       struct object_info info;
-} oi, oi_deref;
+static struct expand_data oi, oi_deref;
 
 /*
  * An atom is a valid field atom listed below, possibly prefixed with
diff --git a/ref-filter.h b/ref-filter.h
index aaeda9f324f5c..fc61457d4d660 100644
--- a/ref-filter.h
+++ b/ref-filter.h
@@ -5,6 +5,7 @@
 #include "refs.h"
 #include "commit.h"
 #include "parse-options.h"
+#include "object-store.h"
 
 /* Quoting styles */
 #define QUOTE_NONE 0
@@ -73,6 +74,17 @@ struct ref_filter {
                verbose;
 };
 
+struct expand_data {
+       struct object_id oid;
+       enum object_type type;
+       unsigned long size;
+       off_t disk_size;
+       struct object_id delta_base_oid;
+       void *content;
+
+       struct object_info info;
+};
+
 struct ref_format {
        /*
         * Set these to define the format; make sure you call

--
https://github.com/git/git/pull/568

Reply via email to