t5536: new test of refspec conflicts when fetching
commit2071e05ed27df847e300b51aca661a34a765aea3
authorMichael Haggerty <mhagger@alum.mit.edu>
Wed, 30 Oct 2013 05:33:08 +0000 (30 06:33 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Oct 2013 21:16:41 +0000 (30 14:16 -0700)
tree2297d3b036c7b1a101addd41200a652dae8a91eb
parent09ea1f8e0e85dd65307b29219ef1f5a3958eb918
t5536: new test of refspec conflicts when fetching

Add some tests that "git fetch" handles refspec conflicts (i.e., when
the same local reference should be updated from two different remote
references) correctly.

There is a small bug when updating references opportunistically,
namely that an explicit user wish like

    git fetch origin \
        refs/heads/branch1:refs/remotes/origin/branch2 \
        refs/heads/branch2:refs/remotes/origin/branch1

should override a configured refspec like

    +refs/heads/*:refs/remotes/origin/*

The current code incorrectly treats this as a fatal error.

In a few commits we will improve the error messages for refspec
conflicts in general and also turn this buggy fatal error into a
warning.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5536-fetch-conflicts.sh [new file with mode: 0755]