]> source.dussan.org Git - jgit.git/commit
Update tags on fetch if --tags or tag refspec specified 80/12280/2
authorRobin Stocker <robin@nibor.org>
Sat, 27 Apr 2013 14:46:29 +0000 (16:46 +0200)
committerRobin Stocker <robin@nibor.org>
Wed, 1 May 2013 14:02:01 +0000 (16:02 +0200)
commitf448d62d29acc996a97ffbbdec955d14fde5c254
treeea158d4a6aa7f6c4ae8ffda1344f4e7f0ae69bb8
parent68b378a4b5e08b80c35e6ad91df25b1034c379a3
Update tags on fetch if --tags or tag refspec specified

When either --tags or a tag ref is explicitly specified on fetch, C Git
updates existing local tags if they are different.

Before this change, JGit returned REJECTED in such a case. Now it
updates it and returns FORCED.

Example:

    % mkdir a
    % cd a
    % git init -q
    % touch test.txt
    % git add test.txt
    % git commit -q -m 'Initial'
    % git tag v1
    % cd ..
    % git clone -q a b
    % cd a
    % echo Test > test.txt
    % git commit -q -a -m 'Second'
    % git tag -f v1
    Updated tag 'v1' (was bc85c08)
    % cd ../b
    % git fetch --tags
     - [tag update]      v1         -> v1

Bug: 388095
Change-Id: I5d5494c2ad1a2cdb8e9e614d3de445289734edfe
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/FetchCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java