]> git.ipfire.org Git - thirdparty/git.git/blobdiff - remote.h
remote: simplify guess_remote_head()
[thirdparty/git.git] / remote.h
index a38774bbdc5acfb5ed9360ac92e1049fa79b26e1..db49ce046704a5ebc65fb2929d46e20f15599a71 100644 (file)
--- a/remote.h
+++ b/remote.h
@@ -1,8 +1,15 @@
 #ifndef REMOTE_H
 #define REMOTE_H
 
+enum {
+       REMOTE_CONFIG,
+       REMOTE_REMOTES,
+       REMOTE_BRANCHES
+};
+
 struct remote {
        const char *name;
+       int origin;
 
        const char **url;
        int url_nr;
@@ -26,6 +33,7 @@ struct remote {
         */
        int fetch_tags;
        int skip_default_update;
+       int mirror;
 
        const char *receivepack;
        const char *uploadpack;
@@ -46,12 +54,15 @@ int remote_has_url(struct remote *remote, const char *url);
 struct refspec {
        unsigned force : 1;
        unsigned pattern : 1;
+       unsigned matching : 1;
 
        char *src;
        char *dst;
 };
 
-struct ref *alloc_ref(unsigned namelen);
+extern const struct refspec *tag_refspec;
+
+struct ref *alloc_ref(const char *name);
 
 struct ref *copy_ref_list(const struct ref *ref);
 
@@ -62,6 +73,9 @@ int check_ref_type(const struct ref *ref, int flags);
  */
 void free_refs(struct ref *ref);
 
+int resolve_remote_symref(struct ref *ref, struct ref *list);
+int ref_newer(const unsigned char *new_sha1, const unsigned char *old_sha1);
+
 /*
  * Removes and frees any duplicate refs in the map.
  */
@@ -69,7 +83,6 @@ void ref_remove_duplicates(struct ref *ref_map);
 
 int valid_fetch_refspec(const char *refspec);
 struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec);
-struct refspec *parse_push_refspec(int nr_refspec, const char **refspec);
 
 int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail,
               int nr_refspec, const char **refspec, int all);
@@ -121,4 +134,17 @@ enum match_refs_flags {
        MATCH_REFS_MIRROR       = (1 << 1),
 };
 
+/* Reporting of tracking info */
+int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs);
+int format_tracking_info(struct branch *branch, struct strbuf *sb);
+
+struct ref *get_local_heads(void);
+
+/*
+ * Look for a ref in refs whose SHA1 matches head, first checking if
+ * refs/heads/master matches. Return NULL if nothing matches or if head
+ * is NULL.
+ */
+const struct ref *guess_remote_head(const struct ref *head,
+                                   const struct ref *refs);
 #endif