path: root/remote.h
diff options
authorJunio C Hamano <>2007-10-27 06:09:48 (GMT)
committerJunio C Hamano <>2007-10-28 21:06:39 (GMT)
commit9ad7c5ae8ae4625bfe32d910b0b480cfea9819e0 (patch)
tree8a838ed84b2cac5f66e0adc5d084d233f90c1ca9 /remote.h
parent071a8877662974f588dfc0b1ac7df2764b7e0337 (diff)
git-fetch: do not fail when remote branch disappears
When the branch named with branch.$name.merge is not covered by the fetch configuration for the remote repository named with branch.$name.remote, we automatically add that branch to the set of branches to be fetched. However, if the remote repository does not have that branch (e.g. it used to exist, but got removed), this is not a reason to fail the git-fetch itself. The situation however will be noticed if git-fetch was called by git-pull, as the resulting FETCH_HEAD would not have any entry that is marked for merging. Acked-By: Daniel Barkalow <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'remote.h')
1 files changed, 4 insertions, 1 deletions
diff --git a/remote.h b/remote.h
index c62636d..878b4ec 100644
--- a/remote.h
+++ b/remote.h
@@ -67,9 +67,12 @@ int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail,
* *tail is the pointer to the tail pointer of the list of results
* beforehand, and will be set to the tail pointer of the list of
* results afterward.
+ *
+ * missing_ok is usually false, but when we are adding branch.$name.merge
+ * it is Ok if the branch is not at the remote anymore.
int get_fetch_map(struct ref *remote_refs, const struct refspec *refspec,
- struct ref ***tail);
+ struct ref ***tail, int missing_ok);
struct ref *get_remote_ref(struct ref *remote_refs, const char *name);