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
c1dbfcbb
Commit
c1dbfcbb
authored
May 28, 2014
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clone: add flag not to link
parent
121b2673
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletions
+4
-1
include/git2/clone.h
+1
-0
src/clone.c
+1
-1
tests/clone/local.c
+2
-0
No files found.
include/git2/clone.h
View file @
c1dbfcbb
...
@@ -27,6 +27,7 @@ typedef enum {
...
@@ -27,6 +27,7 @@ typedef enum {
GIT_CLONE_LOCAL_AUTO
,
GIT_CLONE_LOCAL_AUTO
,
GIT_CLONE_LOCAL
,
GIT_CLONE_LOCAL
,
GIT_CLONE_NO_LOCAL
,
GIT_CLONE_NO_LOCAL
,
GIT_CLONE_LOCAL_NO_LINKS
,
}
git_clone_local_t
;
}
git_clone_local_t
;
/**
/**
...
...
src/clone.c
View file @
c1dbfcbb
...
@@ -357,7 +357,7 @@ int git_clone__should_clone_local(const char *url, git_clone_local_t local)
...
@@ -357,7 +357,7 @@ int git_clone__should_clone_local(const char *url, git_clone_local_t local)
is_url
=
!
git__prefixcmp
(
url
,
"file://"
);
is_url
=
!
git__prefixcmp
(
url
,
"file://"
);
if
(
is_url
&&
local
!=
GIT_CLONE_LOCAL
)
if
(
is_url
&&
local
!=
GIT_CLONE_LOCAL
&&
local
!=
GIT_CLONE_LOCAL_NO_LINKS
)
return
false
;
return
false
;
path
=
url
;
path
=
url
;
...
...
tests/clone/local.c
View file @
c1dbfcbb
...
@@ -19,11 +19,13 @@ void test_clone_local__should_clone_local(void)
...
@@ -19,11 +19,13 @@ void test_clone_local__should_clone_local(void)
cl_git_pass
(
git_buf_printf
(
&
buf
,
"file://%s"
,
cl_fixture
(
"testrepo.git"
)));
cl_git_pass
(
git_buf_printf
(
&
buf
,
"file://%s"
,
cl_fixture
(
"testrepo.git"
)));
cl_assert_equal_i
(
false
,
git_clone__should_clone_local
(
buf
.
ptr
,
GIT_CLONE_LOCAL_AUTO
));
cl_assert_equal_i
(
false
,
git_clone__should_clone_local
(
buf
.
ptr
,
GIT_CLONE_LOCAL_AUTO
));
cl_assert_equal_i
(
true
,
git_clone__should_clone_local
(
buf
.
ptr
,
GIT_CLONE_LOCAL
));
cl_assert_equal_i
(
true
,
git_clone__should_clone_local
(
buf
.
ptr
,
GIT_CLONE_LOCAL
));
cl_assert_equal_i
(
true
,
git_clone__should_clone_local
(
buf
.
ptr
,
GIT_CLONE_LOCAL_NO_LINKS
));
cl_assert_equal_i
(
false
,
git_clone__should_clone_local
(
buf
.
ptr
,
GIT_CLONE_NO_LOCAL
));
cl_assert_equal_i
(
false
,
git_clone__should_clone_local
(
buf
.
ptr
,
GIT_CLONE_NO_LOCAL
));
git_buf_free
(
&
buf
);
git_buf_free
(
&
buf
);
path
=
cl_fixture
(
"testrepo.git"
);
path
=
cl_fixture
(
"testrepo.git"
);
cl_assert_equal_i
(
true
,
git_clone__should_clone_local
(
path
,
GIT_CLONE_LOCAL_AUTO
));
cl_assert_equal_i
(
true
,
git_clone__should_clone_local
(
path
,
GIT_CLONE_LOCAL_AUTO
));
cl_assert_equal_i
(
true
,
git_clone__should_clone_local
(
path
,
GIT_CLONE_LOCAL
));
cl_assert_equal_i
(
true
,
git_clone__should_clone_local
(
path
,
GIT_CLONE_LOCAL
));
cl_assert_equal_i
(
true
,
git_clone__should_clone_local
(
path
,
GIT_CLONE_LOCAL_NO_LINKS
));
cl_assert_equal_i
(
false
,
git_clone__should_clone_local
(
path
,
GIT_CLONE_NO_LOCAL
));
cl_assert_equal_i
(
false
,
git_clone__should_clone_local
(
path
,
GIT_CLONE_NO_LOCAL
));
}
}
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