X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=remote.h;h=de3d21b6626f64ffc54904eec6f26a614feab30a;hb=46ae156d6c8c48d521e4d858ed84d93259cfc61f;hp=d2e170ce664c0efd9ded356c171dabf4b26e452c;hpb=356af64d84076baaf90b0bf8adb7245771264e5a;p=git.git diff --git a/remote.h b/remote.h index d2e170ce6..de3d21b66 100644 --- 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; @@ -67,6 +74,7 @@ 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. @@ -130,4 +138,15 @@ enum match_refs_flags { 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); +/* + * Find refs from a list which are likely to be pointed to by the given HEAD + * ref. If 'all' is false, returns the most likely ref; otherwise, returns a + * list of all candidate refs. If no match is found (or 'head' is NULL), + * returns NULL. All returns are newly allocated and should be freed. + */ +struct ref *guess_remote_head(const struct ref *head, + const struct ref *refs, + int all); + #endif