summaryrefslogtreecommitdiff
path: root/src/remote.c
diff options
context:
space:
mode:
authorLinquize <linquize@yahoo.com.hk>2014-09-05 22:31:53 +0800
committerLinquize <linquize@yahoo.com.hk>2014-09-06 00:26:56 +0800
commitd908351a6c24d2d849e60a62bfb032a34ba96277 (patch)
treea3edd96700f00bd2aeac0726e2bdbf959ce35c3e /src/remote.c
parentd99c8ca1783cfd04869e88f8707c036fc6053a05 (diff)
downloadlibgit2-d908351a6c24d2d849e60a62bfb032a34ba96277.tar.gz
When auto follow tags, FETCH_HEAD should list only newly followed tags
Diffstat (limited to 'src/remote.c')
-rw-r--r--src/remote.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/remote.c b/src/remote.c
index 433015f60..1f98d3cfb 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -1065,16 +1065,20 @@ static int update_tips_for_spec(
if (autotag && !git_odb_exists(odb, &head->oid))
continue;
- if (git_vector_insert(&update_heads, head) < 0)
+ if (!autotag && git_vector_insert(&update_heads, head) < 0)
goto on_error;
error = git_reference_name_to_id(&old, remote->repo, refname.ptr);
if (error < 0 && error != GIT_ENOTFOUND)
goto on_error;
- if (error == GIT_ENOTFOUND)
+ if (error == GIT_ENOTFOUND) {
memset(&old, 0, GIT_OID_RAWSZ);
+ if (autotag && git_vector_insert(&update_heads, head) < 0)
+ goto on_error;
+ }
+
if (!git_oid__cmp(&old, &head->oid))
continue;