X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=remote.h;h=99706a89bc6011c01fcd661d8bad4b26f59b0ca7;hb=8146f19762c8fd67f6df3da4ba87a4e5ea880909;hp=9605da9e1680880218f7939eac50030bb8d252bc;hpb=8ef517337dc684a333111b46d88c3217202f48c3;p=git.git diff --git a/remote.h b/remote.h index 9605da9e1..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); @@ -140,12 +141,13 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb); struct ref *get_local_heads(void); /* - * Look in refs for HEAD. Then look for a matching SHA1 in mapped_refs, - * first checking if refs/heads/master matches. Return NULL if nothing matches - * or if there is no HEAD in refs. remote_head_p is assigned HEAD if not NULL. + * 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. */ -const struct ref *guess_remote_head(const struct ref *refs, - const struct ref *mapped_refs, - const struct ref **remote_head_p); +struct ref *guess_remote_head(const struct ref *head, + const struct ref *refs, + int all); #endif