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
f7fcb18f
Commit
f7fcb18f
authored
Nov 23, 2014
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plug leaks
Valgrind is now clean except for libssl and libgcrypt.
parent
e06b1040
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
14 deletions
+25
-14
src/diff.c
+1
-2
src/iterator.c
+1
-0
src/remote.c
+1
-0
src/transports/local.c
+14
-6
tests/checkout/tree.c
+2
-0
tests/diff/diff_helpers.c
+3
-6
tests/network/remote/local.c
+2
-0
tests/status/ignore.c
+1
-0
No files found.
src/diff.c
View file @
f7fcb18f
...
...
@@ -1234,7 +1234,7 @@ int git_diff_tree_to_workdir(
assert
(
diff
&&
repo
);
if
((
error
=
git_repository_index
(
&
index
,
repo
)))
if
((
error
=
git_repository_index
__weakptr
(
&
index
,
repo
)))
return
error
;
DIFF_FROM_ITERATORS
(
...
...
@@ -1243,7 +1243,6 @@ int git_diff_tree_to_workdir(
&
b
,
repo
,
index
,
old_tree
,
GIT_ITERATOR_DONT_AUTOEXPAND
,
pfx
,
pfx
)
);
git_index_free
(
index
);
return
error
;
}
...
...
src/iterator.c
View file @
f7fcb18f
...
...
@@ -1418,6 +1418,7 @@ static void workdir_iterator__free(git_iterator *self)
workdir_iterator
*
wi
=
(
workdir_iterator
*
)
self
;
if
(
wi
->
index
)
git_index_snapshot_release
(
&
wi
->
index_snapshot
,
wi
->
index
);
git_tree_free
(
wi
->
tree
);
fs_iterator__free
(
self
);
git_ignore__free
(
&
wi
->
ignores
);
}
...
...
src/remote.c
View file @
f7fcb18f
...
...
@@ -995,6 +995,7 @@ static int remote_head_for_ref(git_remote_head **out, git_remote *remote, git_re
error
=
remote_head_for_fetchspec_src
(
out
,
update_heads
,
git_buf_cstr
(
&
remote_name
));
cleanup:
git_buf_free
(
&
remote_name
);
git_reference_free
(
resolved_ref
);
git_config_free
(
config
);
return
error
;
...
...
src/transports/local.c
View file @
f7fcb18f
...
...
@@ -47,6 +47,17 @@ static void free_head(git_remote_head *head)
git__free
(
head
);
}
static
void
free_heads
(
git_vector
*
heads
)
{
git_remote_head
*
head
;
size_t
i
;
git_vector_foreach
(
heads
,
i
,
head
)
free_head
(
head
);
git_vector_free
(
heads
);
}
static
int
add_ref
(
transport_local
*
t
,
const
char
*
name
)
{
const
char
peeled
[]
=
"^{}"
;
...
...
@@ -198,6 +209,8 @@ static int local_connect(
if
(
t
->
connected
)
return
0
;
free_heads
(
&
t
->
refs
);
t
->
url
=
git__strdup
(
url
);
GITERR_CHECK_ALLOC
(
t
->
url
);
t
->
direction
=
direction
;
...
...
@@ -624,13 +637,8 @@ static int local_close(git_transport *transport)
static
void
local_free
(
git_transport
*
transport
)
{
transport_local
*
t
=
(
transport_local
*
)
transport
;
size_t
i
;
git_remote_head
*
head
;
git_vector_foreach
(
&
t
->
refs
,
i
,
head
)
free_head
(
head
);
git_vector_free
(
&
t
->
refs
);
free_heads
(
&
t
->
refs
);
/* Close the transport, if it's still open. */
local_close
(
transport
);
...
...
tests/checkout/tree.c
View file @
f7fcb18f
...
...
@@ -986,6 +986,7 @@ void test_checkout_tree__removes_conflicts(void)
cl_assert
(
!
git_path_exists
(
"testrepo/other.txt"
));
git_commit_free
(
commit
);
git_index_free
(
index
);
}
...
...
@@ -1030,5 +1031,6 @@ void test_checkout_tree__removes_conflicts_only_by_pathscope(void)
cl_assert
(
git_path_exists
(
"testrepo/other.txt"
));
git_commit_free
(
commit
);
git_index_free
(
index
);
}
tests/diff/diff_helpers.c
View file @
f7fcb18f
...
...
@@ -12,12 +12,9 @@ git_tree *resolve_commit_oid_to_tree(
git_tree
*
tree
=
NULL
;
if
(
git_oid_fromstrn
(
&
oid
,
partial_oid
,
len
)
==
0
)
git_object_lookup_prefix
(
&
obj
,
repo
,
&
oid
,
len
,
GIT_OBJ_ANY
);
cl_assert
(
obj
);
if
(
git_object_type
(
obj
)
==
GIT_OBJ_TREE
)
return
(
git_tree
*
)
obj
;
cl_assert
(
git_object_type
(
obj
)
==
GIT_OBJ_COMMIT
);
cl_git_pass
(
git_commit_tree
(
&
tree
,
(
git_commit
*
)
obj
));
cl_git_pass
(
git_object_lookup_prefix
(
&
obj
,
repo
,
&
oid
,
len
,
GIT_OBJ_ANY
));
cl_git_pass
(
git_object_peel
((
git_object
**
)
&
tree
,
obj
,
GIT_OBJ_TREE
));
git_object_free
(
obj
);
return
tree
;
}
...
...
tests/network/remote/local.c
View file @
f7fcb18f
...
...
@@ -172,12 +172,14 @@ void test_network_remote_local__tagopt(void)
cl_git_pass
(
git_remote_fetch
(
remote
,
NULL
,
NULL
,
NULL
));
cl_git_pass
(
git_reference_lookup
(
&
ref
,
repo
,
"refs/remotes/tagopt/master"
));
git_reference_free
(
ref
);
cl_git_pass
(
git_reference_lookup
(
&
ref
,
repo
,
"refs/tags/hard_tag"
));
git_reference_free
(
ref
);
git_remote_set_autotag
(
remote
,
GIT_REMOTE_DOWNLOAD_TAGS_AUTO
);
cl_git_pass
(
git_remote_fetch
(
remote
,
NULL
,
NULL
,
NULL
));
cl_git_pass
(
git_reference_lookup
(
&
ref
,
repo
,
"refs/remotes/tagopt/master"
));
git_reference_free
(
ref
);
}
void
test_network_remote_local__push_to_bare_remote
(
void
)
...
...
tests/status/ignore.c
View file @
f7fcb18f
...
...
@@ -925,6 +925,7 @@ void test_status_ignore__subdir_doesnt_match_above(void)
cl_git_pass
(
git_repository_config_snapshot
(
&
cfg
,
g_repo
));
error
=
git_config_get_bool
(
&
icase
,
cfg
,
"core.ignorecase"
);
git_config_free
(
cfg
);
if
(
error
==
GIT_ENOTFOUND
)
error
=
0
;
...
...
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