]> git.ipfire.org Git - thirdparty/git.git/blobdiff - remote.h
remote.c: add branch_get_push
[thirdparty/git.git] / remote.h
index 357a90963db926b328d3b7df1b9bd3b8515b08b9..312b7ca131c459faeae32ff5cf3021c6516eb2af 100644 (file)
--- a/remote.h
+++ b/remote.h
@@ -209,6 +209,8 @@ struct branch {
        struct refspec **merge;
        int merge_nr;
        int merge_alloc;
+
+       const char *push_tracking_ref;
 };
 
 struct branch *branch_get(const char *name);
@@ -229,6 +231,14 @@ int branch_merge_matches(struct branch *, int n, const char *);
  */
 const char *branch_get_upstream(struct branch *branch, struct strbuf *err);
 
+/**
+ * Return the tracking branch that corresponds to the ref we would push to
+ * given a bare `git push` while `branch` is checked out.
+ *
+ * The return value and `err` conventions match those of `branch_get_upstream`.
+ */
+const char *branch_get_push(struct branch *branch, struct strbuf *err);
+
 /* Flags to match_refs. */
 enum match_refs_flags {
        MATCH_REFS_NONE         = 0,