Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-10-06 00:01:54 +0300
committerJunio C Hamano <gitster@pobox.com>2020-10-06 00:01:54 +0300
commit8e3ec76a20d6abf5dd8ceb3f5f2c157000e4c13e (patch)
tree816c5dc42c7dc8cac732c804b8e99775806bb5dc /builtin/fetch.c
parentf6b06b459092520bd90e5a191589e2d4371ef7d1 (diff)
parentc0192df6306d4d9ad77f6015a053925b13155834 (diff)
Merge branch 'jk/refspecs-negative'
"git fetch" and "git push" support negative refspecs. * jk/refspecs-negative: refspec: add support for negative refspecs
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 25fa1cf931a..f9c3c49f14d 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -539,6 +539,16 @@ static struct ref *get_ref_map(struct remote *remote,
tail = &rm->next;
}
+ /*
+ * apply negative refspecs first, before we remove duplicates. This is
+ * necessary as negative refspecs might remove an otherwise conflicting
+ * duplicate.
+ */
+ if (rs->nr)
+ ref_map = apply_negative_refspecs(ref_map, rs);
+ else
+ ref_map = apply_negative_refspecs(ref_map, &remote->fetch);
+
ref_map = ref_remove_duplicates(ref_map);
for (rm = ref_map; rm; rm = rm->next) {