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
43eeca04
Commit
43eeca04
authored
Nov 01, 2012
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index: Fix tests
parent
276ea401
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
8 deletions
+6
-8
src/index.c
+1
-2
src/stash.c
+1
-1
src/tree.c
+0
-1
tests-clar/index/read_tree.c
+2
-2
tests-clar/object/commit/commitstagedfile.c
+1
-1
tests-clar/stash/stash_helpers.c
+1
-1
No files found.
src/index.c
View file @
43eeca04
...
...
@@ -430,7 +430,6 @@ int git_index_read(git_index *index)
int
git_index_write
(
git_index
*
index
)
{
git_filebuf
file
=
GIT_FILEBUF_INIT
;
struct
stat
indexst
;
int
error
;
if
(
!
index
->
index_file_path
)
{
...
...
@@ -473,7 +472,7 @@ int git_index_write_tree(git_oid *oid, git_index *index)
if
(
repo
==
NULL
)
{
giterr_set
(
GITERR_INDEX
,
"Failed to write tree. "
"The index file is not backed up by an existing repository"
);
return
-
1
return
-
1
;
}
return
git_tree__write_index
(
oid
,
index
,
repo
);
...
...
src/stash.c
View file @
43eeca04
...
...
@@ -115,7 +115,7 @@ static int build_tree_from_index(git_tree **out, git_index *index)
{
git_oid
i_tree_oid
;
if
(
git_
tree_create_fromindex
(
&
i_tree_oid
,
index
)
<
0
)
if
(
git_
index_write_tree
(
&
i_tree_oid
,
index
)
<
0
)
return
-
1
;
return
git_tree_lookup
(
out
,
git_index_owner
(
index
),
&
i_tree_oid
);
...
...
src/tree.c
View file @
43eeca04
...
...
@@ -494,7 +494,6 @@ on_error:
int
git_tree__write_index
(
git_oid
*
oid
,
git_index
*
index
,
git_repository
*
repo
)
{
int
ret
;
git_repository
*
repo
;
assert
(
oid
&&
index
&&
repo
);
...
...
tests-clar/index/read_tree.c
View file @
43eeca04
...
...
@@ -29,14 +29,14 @@ void test_index_read_tree__read_write_involution(void)
cl_git_pass
(
git_index_add_from_workdir
(
index
,
"abc/d"
));
/* write-tree */
cl_git_pass
(
git_
tree_create_fromindex
(
&
expected
,
index
));
cl_git_pass
(
git_
index_write_tree
(
&
expected
,
index
));
/* read-tree */
git_tree_lookup
(
&
tree
,
repo
,
&
expected
);
cl_git_pass
(
git_index_read_tree
(
index
,
tree
));
git_tree_free
(
tree
);
cl_git_pass
(
git_
tree_create_fromindex
(
&
tree_oid
,
index
));
cl_git_pass
(
git_
index_write_tree
(
&
tree_oid
,
index
));
cl_assert
(
git_oid_cmp
(
&
expected
,
&
tree_oid
)
==
0
);
git_index_free
(
index
);
...
...
tests-clar/object/commit/commitstagedfile.c
View file @
43eeca04
...
...
@@ -99,7 +99,7 @@ void test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
/*
* Build the tree from the index
*/
cl_git_pass
(
git_
tree_create_fromindex
(
&
tree_oid
,
index
));
cl_git_pass
(
git_
index_write_tree
(
&
tree_oid
,
index
));
cl_assert
(
git_oid_cmp
(
&
expected_tree_oid
,
&
tree_oid
)
==
0
);
...
...
tests-clar/stash/stash_helpers.c
View file @
43eeca04
...
...
@@ -13,7 +13,7 @@ void commit_staged_files(
repo
=
git_index_owner
(
index
);
cl_git_pass
(
git_
tree_create_fromindex
(
&
tree_oid
,
index
));
cl_git_pass
(
git_
index_write_tree
(
&
tree_oid
,
index
));
cl_git_pass
(
git_tree_lookup
(
&
tree
,
repo
,
&
tree_oid
));
cl_git_pass
(
git_commit_create_v
(
...
...
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