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
c5b2622d
Commit
c5b2622d
authored
Jun 23, 2011
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add git_refspec_transform test
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
parent
92cb6aa9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
tests/t16-remotes.c
+20
-0
No files found.
tests/t16-remotes.c
View file @
c5b2622d
...
...
@@ -79,8 +79,28 @@ BEGIN_TEST(refspec1, "remote fnmatch works as expected")
git_repository_free
(
repo
);
END_TEST
BEGIN_TEST
(
refspec2
,
"refspec transform"
)
git_remote
*
remote
;
git_repository
*
repo
;
git_config
*
cfg
;
const
git_refspec
*
refspec
=
NULL
;
char
ref
[
1024
]
=
{
0
};
must_pass
(
git_repository_open
(
&
repo
,
REPOSITORY_FOLDER
));
must_pass
(
git_repository_config
(
&
cfg
,
repo
,
NULL
,
NULL
));
must_pass
(
git_remote_get
(
&
remote
,
cfg
,
"test"
));
refspec
=
git_remote_fetchspec
(
remote
);
must_be_true
(
refspec
!=
NULL
);
must_pass
(
git_refspec_transform
(
ref
,
sizeof
(
ref
),
refspec
,
"refs/heads/master"
));
must_be_true
(
!
strcmp
(
ref
,
"refs/remotes/test/master"
));
git_remote_free
(
remote
);
git_config_free
(
cfg
);
git_repository_free
(
repo
);
END_TEST
BEGIN_SUITE
(
remotes
)
ADD_TEST
(
remotes0
)
ADD_TEST
(
refspec0
)
ADD_TEST
(
refspec1
)
ADD_TEST
(
refspec2
)
END_SUITE
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