summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-10-05 21:01:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-10-05 21:01:54 (GMT)
commit8e3ec76a20d6abf5dd8ceb3f5f2c157000e4c13e (patch)
tree816c5dc42c7dc8cac732c804b8e99775806bb5dc /builtin
parentf6b06b459092520bd90e5a191589e2d4371ef7d1 (diff)
parentc0192df6306d4d9ad77f6015a053925b13155834 (diff)
downloadgit-8e3ec76a20d6abf5dd8ceb3f5f2c157000e4c13e.zip
git-8e3ec76a20d6abf5dd8ceb3f5f2c157000e4c13e.tar.gz
git-8e3ec76a20d6abf5dd8ceb3f5f2c157000e4c13e.tar.bz2
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')
-rw-r--r--builtin/fetch.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 25fa1cf..f9c3c49 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) {