Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
af2c72d2
Commit
af2c72d2
authored
May 31, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1623 from yorah/fix/tag_auto
remote: make default tag retrieving behaviour consistent
parents
9d6d809b
df50512a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
13 deletions
+8
-13
include/git2/remote.h
+3
-4
src/clone.c
+0
-1
src/remote.c
+2
-8
tests-clar/network/remote/remotes.c
+3
-0
No files found.
include/git2/remote.h
View file @
af2c72d2
...
@@ -426,10 +426,9 @@ GIT_EXTERN(int) git_remote_set_callbacks(git_remote *remote, git_remote_callback
...
@@ -426,10 +426,9 @@ GIT_EXTERN(int) git_remote_set_callbacks(git_remote *remote, git_remote_callback
GIT_EXTERN
(
const
git_transfer_progress
*
)
git_remote_stats
(
git_remote
*
remote
);
GIT_EXTERN
(
const
git_transfer_progress
*
)
git_remote_stats
(
git_remote
*
remote
);
typedef
enum
{
typedef
enum
{
GIT_REMOTE_DOWNLOAD_TAGS_UNSET
,
GIT_REMOTE_DOWNLOAD_TAGS_AUTO
=
0
,
GIT_REMOTE_DOWNLOAD_TAGS_NONE
,
GIT_REMOTE_DOWNLOAD_TAGS_NONE
=
1
,
GIT_REMOTE_DOWNLOAD_TAGS_AUTO
,
GIT_REMOTE_DOWNLOAD_TAGS_ALL
=
2
GIT_REMOTE_DOWNLOAD_TAGS_ALL
}
git_remote_autotag_option_t
;
}
git_remote_autotag_option_t
;
/**
/**
...
...
src/clone.c
View file @
af2c72d2
...
@@ -422,7 +422,6 @@ static void normalize_options(git_clone_options *dst, const git_clone_options *s
...
@@ -422,7 +422,6 @@ static void normalize_options(git_clone_options *dst, const git_clone_options *s
/* Provide defaults for null pointers */
/* Provide defaults for null pointers */
if
(
!
dst
->
remote_name
)
dst
->
remote_name
=
"origin"
;
if
(
!
dst
->
remote_name
)
dst
->
remote_name
=
"origin"
;
if
(
!
dst
->
remote_autotag
)
dst
->
remote_autotag
=
GIT_REMOTE_DOWNLOAD_TAGS_AUTO
;
}
}
int
git_clone
(
int
git_clone
(
...
...
src/remote.c
View file @
af2c72d2
...
@@ -48,11 +48,7 @@ static int download_tags_value(git_remote *remote, git_config *cfg)
...
@@ -48,11 +48,7 @@ static int download_tags_value(git_remote *remote, git_config *cfg)
git_buf
buf
=
GIT_BUF_INIT
;
git_buf
buf
=
GIT_BUF_INIT
;
int
error
;
int
error
;
if
(
remote
->
download_tags
!=
GIT_REMOTE_DOWNLOAD_TAGS_UNSET
)
/* The 0 value is the default (auto), let's see if we need to change it */
return
0
;
/* This is the default, let's see if we need to change it */
remote
->
download_tags
=
GIT_REMOTE_DOWNLOAD_TAGS_AUTO
;
if
(
git_buf_printf
(
&
buf
,
"remote.%s.tagopt"
,
remote
->
name
)
<
0
)
if
(
git_buf_printf
(
&
buf
,
"remote.%s.tagopt"
,
remote
->
name
)
<
0
)
return
-
1
;
return
-
1
;
...
@@ -117,10 +113,9 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
...
@@ -117,10 +113,9 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
goto
on_error
;
goto
on_error
;
}
}
if
(
!
name
)
/* A remote without a name doesn't download tags */
/* A remote without a name doesn't download tags */
if
(
!
name
)
{
remote
->
download_tags
=
GIT_REMOTE_DOWNLOAD_TAGS_NONE
;
remote
->
download_tags
=
GIT_REMOTE_DOWNLOAD_TAGS_NONE
;
}
*
out
=
remote
;
*
out
=
remote
;
git_buf_free
(
&
fetchbuf
);
git_buf_free
(
&
fetchbuf
);
...
@@ -246,7 +241,6 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
...
@@ -246,7 +241,6 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
git_config
*
config
;
git_config
*
config
;
struct
refspec_cb_data
data
;
struct
refspec_cb_data
data
;
assert
(
out
&&
repo
&&
name
);
assert
(
out
&&
repo
&&
name
);
if
((
error
=
ensure_remote_name_is_valid
(
name
))
<
0
)
if
((
error
=
ensure_remote_name_is_valid
(
name
))
<
0
)
...
...
tests-clar/network/remote/remotes.c
View file @
af2c72d2
...
@@ -286,11 +286,14 @@ void test_network_remote_remotes__add(void)
...
@@ -286,11 +286,14 @@ void test_network_remote_remotes__add(void)
_remote
=
NULL
;
_remote
=
NULL
;
cl_git_pass
(
git_remote_create
(
&
_remote
,
_repo
,
"addtest"
,
"http://github.com/libgit2/libgit2"
));
cl_git_pass
(
git_remote_create
(
&
_remote
,
_repo
,
"addtest"
,
"http://github.com/libgit2/libgit2"
));
cl_assert_equal_i
(
GIT_REMOTE_DOWNLOAD_TAGS_AUTO
,
git_remote_autotag
(
_remote
));
git_remote_free
(
_remote
);
git_remote_free
(
_remote
);
_remote
=
NULL
;
_remote
=
NULL
;
cl_git_pass
(
git_remote_load
(
&
_remote
,
_repo
,
"addtest"
));
cl_git_pass
(
git_remote_load
(
&
_remote
,
_repo
,
"addtest"
));
cl_assert_equal_i
(
GIT_REMOTE_DOWNLOAD_TAGS_AUTO
,
git_remote_autotag
(
_remote
));
_refspec
=
git_vector_get
(
&
_remote
->
refspecs
,
0
);
_refspec
=
git_vector_get
(
&
_remote
->
refspecs
,
0
);
cl_assert_equal_s
(
"refs/heads/*"
,
git_refspec_src
(
_refspec
));
cl_assert_equal_s
(
"refs/heads/*"
,
git_refspec_src
(
_refspec
));
cl_assert
(
git_refspec_force
(
_refspec
)
==
1
);
cl_assert
(
git_refspec_force
(
_refspec
)
==
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment