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
438c9958
Commit
438c9958
authored
Jun 10, 2019
by
Robert Coup
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix memleaks in analysis tests.
Wrap some missed setup api calls in asserts.
parent
21ddeabe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
tests/merge/analysis.c
+9
-5
No files found.
tests/merge/analysis.c
View file @
438c9958
...
@@ -114,7 +114,7 @@ void testimpl_merge_analysis__unborn(void)
...
@@ -114,7 +114,7 @@ void testimpl_merge_analysis__unborn(void)
git_merge_preference_t
merge_pref
;
git_merge_preference_t
merge_pref
;
git_buf
master
=
GIT_BUF_INIT
;
git_buf
master
=
GIT_BUF_INIT
;
git_buf_joinpath
(
&
master
,
git_repository_path
(
repo
),
"refs/heads/master"
);
cl_git_pass
(
git_buf_joinpath
(
&
master
,
git_repository_path
(
repo
),
"refs/heads/master"
)
);
p_unlink
(
git_buf_cstr
(
&
master
));
p_unlink
(
git_buf_cstr
(
&
master
));
analysis_from_branch
(
&
merge_analysis
,
&
merge_pref
,
NULL
,
NOFASTFORWARD_BRANCH
);
analysis_from_branch
(
&
merge_analysis
,
&
merge_pref
,
NULL
,
NOFASTFORWARD_BRANCH
);
...
@@ -129,13 +129,15 @@ void testimpl_merge_analysis__fastforward_with_config_noff(void)
...
@@ -129,13 +129,15 @@ void testimpl_merge_analysis__fastforward_with_config_noff(void)
git_merge_analysis_t
merge_analysis
;
git_merge_analysis_t
merge_analysis
;
git_merge_preference_t
merge_pref
;
git_merge_preference_t
merge_pref
;
git_repository_config
(
&
config
,
repo
);
cl_git_pass
(
git_repository_config
(
&
config
,
repo
)
);
git_config_set_string
(
config
,
"merge.ff"
,
"false"
);
cl_git_pass
(
git_config_set_string
(
config
,
"merge.ff"
,
"false"
)
);
analysis_from_branch
(
&
merge_analysis
,
&
merge_pref
,
NULL
,
FASTFORWARD_BRANCH
);
analysis_from_branch
(
&
merge_analysis
,
&
merge_pref
,
NULL
,
FASTFORWARD_BRANCH
);
cl_assert_equal_i
(
GIT_MERGE_ANALYSIS_NORMAL
|
GIT_MERGE_ANALYSIS_FASTFORWARD
,
merge_analysis
);
cl_assert_equal_i
(
GIT_MERGE_ANALYSIS_NORMAL
|
GIT_MERGE_ANALYSIS_FASTFORWARD
,
merge_analysis
);
cl_assert_equal_i
(
GIT_MERGE_PREFERENCE_NO_FASTFORWARD
,
(
merge_pref
&
GIT_MERGE_PREFERENCE_NO_FASTFORWARD
));
cl_assert_equal_i
(
GIT_MERGE_PREFERENCE_NO_FASTFORWARD
,
(
merge_pref
&
GIT_MERGE_PREFERENCE_NO_FASTFORWARD
));
git_config_free
(
config
);
}
}
void
testimpl_merge_analysis__no_fastforward_with_config_ffonly
(
void
)
void
testimpl_merge_analysis__no_fastforward_with_config_ffonly
(
void
)
...
@@ -144,13 +146,15 @@ void testimpl_merge_analysis__no_fastforward_with_config_ffonly(void)
...
@@ -144,13 +146,15 @@ void testimpl_merge_analysis__no_fastforward_with_config_ffonly(void)
git_merge_analysis_t
merge_analysis
;
git_merge_analysis_t
merge_analysis
;
git_merge_preference_t
merge_pref
;
git_merge_preference_t
merge_pref
;
git_repository_config
(
&
config
,
repo
);
cl_git_pass
(
git_repository_config
(
&
config
,
repo
)
);
git_config_set_string
(
config
,
"merge.ff"
,
"only"
);
cl_git_pass
(
git_config_set_string
(
config
,
"merge.ff"
,
"only"
)
);
analysis_from_branch
(
&
merge_analysis
,
&
merge_pref
,
NULL
,
NOFASTFORWARD_BRANCH
);
analysis_from_branch
(
&
merge_analysis
,
&
merge_pref
,
NULL
,
NOFASTFORWARD_BRANCH
);
cl_assert_equal_i
(
GIT_MERGE_ANALYSIS_NORMAL
,
merge_analysis
);
cl_assert_equal_i
(
GIT_MERGE_ANALYSIS_NORMAL
,
merge_analysis
);
cl_assert_equal_i
(
GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY
,
(
merge_pref
&
GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY
));
cl_assert_equal_i
(
GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY
,
(
merge_pref
&
GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY
));
git_config_free
(
config
);
}
}
void
testimpl_merge_analysis__between_uptodate_refs
(
void
)
void
testimpl_merge_analysis__between_uptodate_refs
(
void
)
...
...
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