mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-05 07:29:21 +00:00
tree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode()
This commit is contained in:
parent
a7dbac0b23
commit
9d7ac675d0
@ -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
|
||||
|
@ -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),
|
||||
|
@ -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));
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user