Code

Merge branch 'sb/maint-1.6.0-add-config-fix' into maint
[git.git] / remote.h
index 9605da9e1680880218f7939eac50030bb8d252bc..99706a89bc6011c01fcd661d8bad4b26f59b0ca7 100644 (file)
--- 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