diff options
author | Robin Stocker <robin@nibor.org> | 2013-04-27 16:46:29 +0200 |
---|---|---|
committer | Robin Stocker <robin@nibor.org> | 2013-05-01 16:02:01 +0200 |
commit | f448d62d29acc996a97ffbbdec955d14fde5c254 (patch) | |
tree | ea158d4a6aa7f6c4ae8ffda1344f4e7f0ae69bb8 /org.eclipse.jgit | |
parent | 68b378a4b5e08b80c35e6ad91df25b1034c379a3 (diff) | |
download | jgit-f448d62d29acc996a97ffbbdec955d14fde5c254.tar.gz jgit-f448d62d29acc996a97ffbbdec955d14fde5c254.zip |
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
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java index 9a11dbda65..52a9bab4b6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java @@ -412,7 +412,7 @@ class FetchProcess { private void wantTag(final Ref r) throws TransportException { want(r, new RefSpec().setSource(r.getName()) - .setDestination(r.getName())); + .setDestination(r.getName()).setForceUpdate(true)); } private void want(final Ref src, final RefSpec spec) |