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
a7fcc44d
Commit
a7fcc44d
authored
Sep 05, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better macro name for is-exec-bit-set test
parent
af22dabb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
+8
-8
src/checkout.c
+1
-1
src/diff_print.c
+1
-1
src/fileops.h
+3
-3
src/tree.c
+1
-1
tests-clar/index/addall.c
+1
-1
tests-clar/repo/init.c
+1
-1
No files found.
src/checkout.c
View file @
a7fcc44d
...
@@ -696,7 +696,7 @@ static int buffer_to_file(
...
@@ -696,7 +696,7 @@ static int buffer_to_file(
if
(
st
!=
NULL
&&
(
error
=
p_stat
(
path
,
st
))
<
0
)
if
(
st
!=
NULL
&&
(
error
=
p_stat
(
path
,
st
))
<
0
)
giterr_set
(
GITERR_OS
,
"Error statting '%s'"
,
path
);
giterr_set
(
GITERR_OS
,
"Error statting '%s'"
,
path
);
else
if
(
GIT_PERMS_
EXECUTABLE
(
file_mode
)
&&
else
if
(
GIT_PERMS_
IS_EXEC
(
file_mode
)
&&
(
error
=
p_chmod
(
path
,
file_mode
))
<
0
)
(
error
=
p_chmod
(
path
,
file_mode
))
<
0
)
giterr_set
(
GITERR_OS
,
"Failed to set permissions on '%s'"
,
path
);
giterr_set
(
GITERR_OS
,
"Failed to set permissions on '%s'"
,
path
);
...
...
src/diff_print.c
View file @
a7fcc44d
...
@@ -46,7 +46,7 @@ static char diff_pick_suffix(int mode)
...
@@ -46,7 +46,7 @@ static char diff_pick_suffix(int mode)
{
{
if
(
S_ISDIR
(
mode
))
if
(
S_ISDIR
(
mode
))
return
'/'
;
return
'/'
;
else
if
(
GIT_PERMS_
EXECUTABLE
(
mode
))
/* -V536 */
else
if
(
GIT_PERMS_
IS_EXEC
(
mode
))
/* -V536 */
/* in git, modes are very regular, so we must have 0100755 mode */
/* in git, modes are very regular, so we must have 0100755 mode */
return
'*'
;
return
'*'
;
else
else
...
...
src/fileops.h
View file @
a7fcc44d
...
@@ -223,9 +223,9 @@ extern int git_futils_open_ro(const char *path);
...
@@ -223,9 +223,9 @@ extern int git_futils_open_ro(const char *path);
*/
*/
extern
git_off_t
git_futils_filesize
(
git_file
fd
);
extern
git_off_t
git_futils_filesize
(
git_file
fd
);
#define GIT_PERMS_
EXECUTABLE(MODE)
(((MODE) & 0111) != 0)
#define GIT_PERMS_
IS_EXEC(MODE)
(((MODE) & 0111) != 0)
#define GIT_PERMS_CANONICAL(MODE) (GIT_PERMS_
EXECUTABLE
(MODE) ? 0755 : 0644)
#define GIT_PERMS_CANONICAL(MODE) (GIT_PERMS_
IS_EXEC
(MODE) ? 0755 : 0644)
#define GIT_PERMS_FOR_WRITE(MODE) (GIT_PERMS_
EXECUTABLE
(MODE) ? 0777 : 0666)
#define GIT_PERMS_FOR_WRITE(MODE) (GIT_PERMS_
IS_EXEC
(MODE) ? 0777 : 0666)
#define GIT_MODE_PERMS_MASK 0777
#define GIT_MODE_PERMS_MASK 0777
#define GIT_MODE_TYPE_MASK 0170000
#define GIT_MODE_TYPE_MASK 0170000
...
...
src/tree.c
View file @
a7fcc44d
...
@@ -33,7 +33,7 @@ GIT_INLINE(git_filemode_t) normalize_filemode(git_filemode_t filemode)
...
@@ -33,7 +33,7 @@ GIT_INLINE(git_filemode_t) normalize_filemode(git_filemode_t filemode)
return
GIT_FILEMODE_TREE
;
return
GIT_FILEMODE_TREE
;
/* If any of the x bits are set */
/* If any of the x bits are set */
if
(
GIT_PERMS_
EXECUTABLE
(
filemode
))
if
(
GIT_PERMS_
IS_EXEC
(
filemode
))
return
GIT_FILEMODE_BLOB_EXECUTABLE
;
return
GIT_FILEMODE_BLOB_EXECUTABLE
;
/* 16XXXX means commit */
/* 16XXXX means commit */
...
...
tests-clar/index/addall.c
View file @
a7fcc44d
...
@@ -112,7 +112,7 @@ static void check_stat_data(git_index *index, const char *path, bool match)
...
@@ -112,7 +112,7 @@ static void check_stat_data(git_index *index, const char *path, bool match)
cl_assert_equal_i_fmt
(
cl_assert_equal_i_fmt
(
GIT_MODE_TYPE
(
st
.
st_mode
),
GIT_MODE_TYPE
(
entry
->
mode
),
"%07o"
);
GIT_MODE_TYPE
(
st
.
st_mode
),
GIT_MODE_TYPE
(
entry
->
mode
),
"%07o"
);
cl_assert_equal_b
(
cl_assert_equal_b
(
GIT_PERMS_
EXECUTABLE
(
st
.
st_mode
),
GIT_PERMS_EXECUTABLE
(
entry
->
mode
));
GIT_PERMS_
IS_EXEC
(
st
.
st_mode
),
GIT_PERMS_IS_EXEC
(
entry
->
mode
));
}
else
{
}
else
{
/* most things will still match */
/* most things will still match */
cl_assert
(
st
.
st_size
!=
entry
->
file_size
);
cl_assert
(
st
.
st_size
!=
entry
->
file_size
);
...
...
tests-clar/repo/init.c
View file @
a7fcc44d
...
@@ -422,7 +422,7 @@ static void assert_mode_seems_okay(
...
@@ -422,7 +422,7 @@ static void assert_mode_seems_okay(
cl_assert_equal_b
(
expect_setgid
,
(
st
.
st_mode
&
S_ISGID
)
!=
0
);
cl_assert_equal_b
(
expect_setgid
,
(
st
.
st_mode
&
S_ISGID
)
!=
0
);
cl_assert_equal_b
(
cl_assert_equal_b
(
GIT_PERMS_
EXECUTABLE
(
expect_mode
),
GIT_PERMS_EXECUTABLE
(
st
.
st_mode
));
GIT_PERMS_
IS_EXEC
(
expect_mode
),
GIT_PERMS_IS_EXEC
(
st
.
st_mode
));
cl_assert_equal_i_fmt
(
cl_assert_equal_i_fmt
(
GIT_MODE_TYPE
(
expect_mode
),
GIT_MODE_TYPE
(
st
.
st_mode
),
"%07o"
);
GIT_MODE_TYPE
(
expect_mode
),
GIT_MODE_TYPE
(
st
.
st_mode
),
"%07o"
);
...
...
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