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
9d7ac675
Commit
9d7ac675
authored
Aug 21, 2012
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode()
parent
a7dbac0b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
include/git2/tree.h
+2
-2
src/checkout.c
+2
-2
src/notes.c
+1
-1
src/tree.c
+2
-2
tests-clar/object/tree/attributes.c
+5
-5
No files found.
include/git2/tree.h
View file @
9d7ac675
...
...
@@ -143,9 +143,9 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byoid(git_tree *tree, const gi
* Get the UNIX file attributes of a tree entry
*
* @param entry a tree entry
* @return
attributes
as an integer
* @return
filemode
as an integer
*/
GIT_EXTERN
(
unsigned
int
)
git_tree_entry_attributes
(
const
git_tree_entry
*
entry
);
GIT_EXTERN
(
git_filemode_t
)
git_tree_entry_filemode
(
const
git_tree_entry
*
entry
);
/**
* Get the filename of a tree entry
...
...
src/checkout.c
View file @
9d7ac675
...
...
@@ -88,7 +88,7 @@ static int blob_contents_to_file(git_repository *repo, git_buf *fnbuf,
/* Allow overriding of file mode */
if
(
!
file_mode
)
file_mode
=
git_tree_entry_
attributes
(
entry
);
file_mode
=
git_tree_entry_
filemode
(
entry
);
if
((
retcode
=
git_futils_mkpath2file
(
git_buf_cstr
(
fnbuf
),
data
->
opts
->
dir_mode
))
<
0
)
goto
bctf_cleanup
;
...
...
@@ -111,7 +111,7 @@ static int checkout_walker(const char *path, const git_tree_entry *entry, void *
{
int
retcode
=
0
;
tree_walk_data
*
data
=
(
tree_walk_data
*
)
payload
;
int
attr
=
git_tree_entry_
attributes
(
entry
);
int
attr
=
git_tree_entry_
filemode
(
entry
);
git_buf
fnbuf
=
GIT_BUF_INIT
;
git_buf_join_n
(
&
fnbuf
,
'/'
,
3
,
git_repository_workdir
(
data
->
repo
),
...
...
src/notes.c
View file @
9d7ac675
...
...
@@ -33,7 +33,7 @@ static int find_subtree_in_current_level(
if
(
!
git__ishex
(
git_tree_entry_name
(
entry
)))
continue
;
if
(
S_ISDIR
(
git_tree_entry_
attributes
(
entry
))
if
(
S_ISDIR
(
git_tree_entry_
filemode
(
entry
))
&&
strlen
(
git_tree_entry_name
(
entry
))
==
2
&&
!
strncmp
(
git_tree_entry_name
(
entry
),
annotated_object_sha
+
fanout
,
2
))
return
git_tree_lookup
(
out
,
repo
,
git_tree_entry_id
(
entry
));
...
...
src/tree.c
View file @
9d7ac675
...
...
@@ -185,9 +185,9 @@ const git_oid *git_tree_id(git_tree *c)
return
git_object_id
((
git_object
*
)
c
);
}
unsigned
int
git_tree_entry_attributes
(
const
git_tree_entry
*
entry
)
git_filemode_t
git_tree_entry_filemode
(
const
git_tree_entry
*
entry
)
{
return
entry
->
attr
;
return
(
git_filemode_t
)
entry
->
attr
;
}
const
char
*
git_tree_entry_name
(
const
git_tree_entry
*
entry
)
...
...
tests-clar/object/tree/attributes.c
View file @
9d7ac675
...
...
@@ -35,7 +35,7 @@ void test_object_tree_attributes__group_writable_tree_entries_created_with_an_an
entry
=
git_tree_entry_byname
(
tree
,
"old_mode.txt"
);
cl_assert_equal_i
(
GIT_FILEMODE_BLOB_GROUP_WRITABLE
,
git_tree_entry_
attributes
(
entry
));
git_tree_entry_
filemode
(
entry
));
git_tree_free
(
tree
);
git_repository_free
(
repo
);
...
...
@@ -64,7 +64,7 @@ void test_object_tree_attributes__normalize_attributes_when_inserting_in_a_new_t
cl_assert_equal_i
(
GIT_FILEMODE_BLOB
,
git_tree_entry_
attributes
(
entry
));
git_tree_entry_
filemode
(
entry
));
cl_git_pass
(
git_treebuilder_write
(
&
tid
,
repo
,
builder
));
git_treebuilder_free
(
builder
);
...
...
@@ -74,7 +74,7 @@ void test_object_tree_attributes__normalize_attributes_when_inserting_in_a_new_t
entry
=
git_tree_entry_byname
(
tree
,
"normalized.txt"
);
cl_assert_equal_i
(
GIT_FILEMODE_BLOB
,
git_tree_entry_
attributes
(
entry
));
git_tree_entry_
filemode
(
entry
));
git_tree_free
(
tree
);
cl_git_sandbox_cleanup
();
...
...
@@ -98,7 +98,7 @@ void test_object_tree_attributes__normalize_attributes_when_creating_a_tree_from
entry
=
git_treebuilder_get
(
builder
,
"old_mode.txt"
);
cl_assert_equal_i
(
GIT_FILEMODE_BLOB
,
git_tree_entry_
attributes
(
entry
));
git_tree_entry_
filemode
(
entry
));
cl_git_pass
(
git_treebuilder_write
(
&
tid2
,
repo
,
builder
));
git_treebuilder_free
(
builder
);
...
...
@@ -108,7 +108,7 @@ void test_object_tree_attributes__normalize_attributes_when_creating_a_tree_from
entry
=
git_tree_entry_byname
(
tree
,
"old_mode.txt"
);
cl_assert_equal_i
(
GIT_FILEMODE_BLOB
,
git_tree_entry_
attributes
(
entry
));
git_tree_entry_
filemode
(
entry
));
git_tree_free
(
tree
);
cl_git_sandbox_cleanup
();
...
...
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