fetch: send server options when using protocol v2
[gitweb.git] / remote.h
index 368ba221cc9092025f61b7edfbafe29b345c0645..93dd97e25f75ff88090dce0d92e0cf18dbdc3295 100644 (file)
--- a/remote.h
+++ b/remote.h
@@ -47,6 +47,7 @@ struct remote {
        int skip_default_update;
        int mirror;
        int prune;
+       int prune_tags;
 
        const char *receivepack;
        const char *uploadpack;
@@ -152,6 +153,7 @@ void free_refs(struct ref *ref);
 struct oid_array;
 struct packet_reader;
 struct argv_array;
+struct string_list;
 extern struct ref **get_remote_heads(struct packet_reader *reader,
                                     struct ref **list, unsigned int flags,
                                     struct oid_array *extra_have,
@@ -160,7 +162,8 @@ extern struct ref **get_remote_heads(struct packet_reader *reader,
 /* Used for protocol v2 in order to retrieve refs from a remote */
 extern struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
                                    struct ref **list, int for_push,
-                                   const struct argv_array *ref_prefixes);
+                                   const struct argv_array *ref_prefixes,
+                                   const struct string_list *server_options);
 
 int resolve_remote_symref(struct ref *ref, struct ref *list);
 int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid);
@@ -264,10 +267,18 @@ enum match_refs_flags {
        MATCH_REFS_FOLLOW_TAGS  = (1 << 3)
 };
 
+/* Flags for --ahead-behind option. */
+enum ahead_behind_flags {
+       AHEAD_BEHIND_UNSPECIFIED = -1,
+       AHEAD_BEHIND_QUICK       =  0,  /* just eq/neq reporting */
+       AHEAD_BEHIND_FULL        =  1,  /* traditional a/b reporting */
+};
+
 /* Reporting of tracking info */
 int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs,
-                      const char **upstream_name);
-int format_tracking_info(struct branch *branch, struct strbuf *sb);
+                      const char **upstream_name, enum ahead_behind_flags abf);
+int format_tracking_info(struct branch *branch, struct strbuf *sb,
+                        enum ahead_behind_flags abf);
 
 struct ref *get_local_heads(void);
 /*
@@ -304,4 +315,8 @@ extern int parseopt_push_cas_option(const struct option *, const char *arg, int
 extern int is_empty_cas(const struct push_cas_option *);
 void apply_push_cas(struct push_cas_option *, struct remote *, struct ref *);
 
+#define TAG_REFSPEC "refs/tags/*:refs/tags/*"
+
+void add_prune_tags_to_fetch_refspec(struct remote *remote);
+
 #endif