X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=remote.h;h=99706a89bc6011c01fcd661d8bad4b26f59b0ca7;hb=d1f6c18bd6ea5fd373f9f6356e02854678ffa0fd;hp=a46a5be131caf1d1d71f97cab3c3ba2cebb6386c;hpb=f7af75777fd5a217d43acb2098cf043a73c20b01;p=git.git diff --git a/remote.h b/remote.h index a46a5be13..99706a89b 100644 --- a/remote.h +++ b/remote.h @@ -45,6 +45,7 @@ struct remote { }; struct remote *remote_get(const char *name); +int remote_is_configured(const char *name); typedef int each_remote_fn(struct remote *remote, void *priv); int for_each_remote(each_remote_fn fn, void *priv); @@ -74,6 +75,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. @@ -137,4 +139,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