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
8a00de08
Unverified
Commit
8a00de08
authored
Jul 06, 2018
by
Patrick Steinhardt
Committed by
GitHub
Jul 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4699 from nelhage/fetch-null-dst
git_refspec_transform: Handle NULL dst
parents
c43658f6
ff8edac9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
src/refspec.c
+1
-1
tests/network/refspecs.c
+5
-0
No files found.
src/refspec.c
View file @
8a00de08
...
...
@@ -277,7 +277,7 @@ int git_refspec_transform(git_buf *out, const git_refspec *spec, const char *nam
}
if
(
!
spec
->
pattern
)
return
git_buf_puts
(
out
,
spec
->
dst
);
return
git_buf_puts
(
out
,
spec
->
dst
?
spec
->
dst
:
""
);
return
refspec_transform
(
out
,
spec
->
src
,
spec
->
dst
,
name
);
}
...
...
tests/network/refspecs.c
View file @
8a00de08
...
...
@@ -111,6 +111,11 @@ void test_network_refspecs__transform_mid_star(void)
assert_valid_transform
(
"refs/*:refs/*"
,
"refs/heads/master"
,
"refs/heads/master"
);
}
void
test_network_refspecs__no_dst
(
void
)
{
assert_valid_transform
(
"refs/heads/master:"
,
"refs/heads/master"
,
""
);
}
static
void
assert_invalid_transform
(
const
char
*
refspec
,
const
char
*
name
)
{
git_refspec
spec
;
...
...
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