From b42f69273bf5ae2d5bb0c7479bfa9827e7b351ac Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 10 Jul 2007 18:48:40 +0100 Subject: Add for_each_remote() function, and extend remote_find_tracking() The function for_each_remote() does exactly what the name suggests. The function remote_find_tracking() was extended to be able to search remote refs for a given local ref. The caller sets either src or dst (but not both) in the refspec parameter, and remote_find_tracking() will fill in the other and return 0. Both changes are required for the next step: simplification of git-branch's --track functionality. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- remote.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'remote.h') diff --git a/remote.h b/remote.h index 080b7dab9..17b8b5b5d 100644 --- a/remote.h +++ b/remote.h @@ -20,13 +20,16 @@ struct remote { struct remote *remote_get(const char *name); +typedef int each_remote_fn(struct remote *remote, void *priv); +int for_each_remote(each_remote_fn fn, void *priv); + int remote_has_uri(struct remote *remote, const char *uri); struct refspec { unsigned force : 1; unsigned pattern : 1; - const char *src; + char *src; char *dst; }; -- cgit v1.2.1