diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2007-07-10 18:48:40 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-07-11 15:28:15 -0700 |
commit | b42f69273bf5ae2d5bb0c7479bfa9827e7b351ac (patch) | |
tree | 67849e4e3354317f92e8dd6acf1d941e05bf2778 /send-pack.c | |
parent | 5206d13091a38b2fef534c78e893814dbab0af26 (diff) | |
download | git-b42f69273bf5ae2d5bb0c7479bfa9827e7b351ac.tar.gz |
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 <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'send-pack.c')
-rw-r--r-- | send-pack.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/send-pack.c b/send-pack.c index fecbda981b..9fc8a812f4 100644 --- a/send-pack.c +++ b/send-pack.c @@ -305,8 +305,8 @@ static int send_pack(int in, int out, struct remote *remote, int nr_refspec, cha if (remote) { struct refspec rs; rs.src = ref->name; - remote_find_tracking(remote, &rs); - if (rs.dst) { + rs.dst = NULL; + if (!remote_find_tracking(remote, &rs)) { struct ref_lock *lock; fprintf(stderr, " Also local %s\n", rs.dst); if (will_delete_ref) { |