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
efc4e7e5
Unverified
Commit
efc4e7e5
authored
Aug 25, 2021
by
Edward Thomson
Committed by
GitHub
Aug 25, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5802 from lhchavez/git-warn-unused-result
Introduce GIT_WARN_UNUSED_RESULT
parents
0850b172
991ccdc5
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
65 additions
and
35 deletions
+65
-35
src/cc-compat.h
+9
-1
src/common.h
+18
-0
src/odb.c
+2
-2
src/path.c
+7
-1
src/refdb_fs.c
+3
-3
src/sortedcache.h
+9
-7
src/vector.h
+4
-2
src/win32/path_w32.h
+0
-1
tests/core/sha1.c
+1
-1
tests/core/sortedcache.c
+3
-3
tests/core/vector.c
+6
-6
tests/fetchhead/nonetwork.c
+1
-1
tests/index/addall.c
+1
-3
tests/index/bypath.c
+1
-4
No files found.
src/cc-compat.h
View file @
efc4e7e5
...
@@ -43,7 +43,15 @@
...
@@ -43,7 +43,15 @@
# define GIT_ALIGN(x,size) x
# define GIT_ALIGN(x,size) x
#endif
#endif
#define GIT_UNUSED(x) ((void)(x))
#if defined(__GNUC__)
# define GIT_UNUSED(x) \
do { \
typeof(x) _unused __attribute__((unused)); \
_unused = (x); \
} while (0)
#else
# define GIT_UNUSED(x) ((void)(x))
#endif
/* Define the printf format specifier to use for size_t output */
/* Define the printf format specifier to use for size_t output */
#if defined(_MSC_VER) || defined(__MINGW32__)
#if defined(_MSC_VER) || defined(__MINGW32__)
...
...
src/common.h
View file @
efc4e7e5
...
@@ -30,6 +30,24 @@
...
@@ -30,6 +30,24 @@
# define __has_builtin(x) 0
# define __has_builtin(x) 0
#endif
#endif
/**
* Declare that a function's return value must be used.
*
* Used mostly to guard against potential silent bugs at runtime. This is
* recommended to be added to functions that:
*
* - Allocate / reallocate memory. This prevents memory leaks or errors where
* buffers are expected to have grown to a certain size, but could not be
* resized.
* - Acquire locks. When a lock cannot be acquired, that will almost certainly
* cause a data race / undefined behavior.
*/
#if defined(__GNUC__)
# define GIT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
# define GIT_WARN_UNUSED_RESULT
#endif
#include <assert.h>
#include <assert.h>
#include <errno.h>
#include <errno.h>
#include <limits.h>
#include <limits.h>
...
...
src/odb.c
View file @
efc4e7e5
...
@@ -573,7 +573,7 @@ int git_odb__add_default_backends(
...
@@ -573,7 +573,7 @@ int git_odb__add_default_backends(
git_odb
*
db
,
const
char
*
objects_dir
,
git_odb
*
db
,
const
char
*
objects_dir
,
bool
as_alternates
,
int
alternate_depth
)
bool
as_alternates
,
int
alternate_depth
)
{
{
size_t
i
;
size_t
i
=
0
;
struct
stat
st
;
struct
stat
st
;
ino_t
inode
;
ino_t
inode
;
git_odb_backend
*
loose
,
*
packed
;
git_odb_backend
*
loose
,
*
packed
;
...
@@ -582,7 +582,7 @@ int git_odb__add_default_backends(
...
@@ -582,7 +582,7 @@ int git_odb__add_default_backends(
* a cross-platform workaround for this */
* a cross-platform workaround for this */
#ifdef GIT_WIN32
#ifdef GIT_WIN32
GIT_UNUSED
(
i
);
GIT_UNUSED
(
i
);
GIT_UNUSED
(
st
);
GIT_UNUSED
(
&
st
);
inode
=
0
;
inode
=
0
;
#else
#else
...
...
src/path.c
View file @
efc4e7e5
...
@@ -1915,7 +1915,13 @@ GIT_INLINE(bool) should_validate_longpaths(git_repository *repo)
...
@@ -1915,7 +1915,13 @@ GIT_INLINE(bool) should_validate_longpaths(git_repository *repo)
}
}
#else
#else
# define should_validate_longpaths(repo) (GIT_UNUSED(repo), false)
GIT_INLINE
(
bool
)
should_validate_longpaths
(
git_repository
*
repo
)
{
GIT_UNUSED
(
repo
);
return
false
;
}
#endif
#endif
int
git_path_validate_workdir
(
git_repository
*
repo
,
const
char
*
path
)
int
git_path_validate_workdir
(
git_repository
*
repo
,
const
char
*
path
)
...
...
src/refdb_fs.c
View file @
efc4e7e5
...
@@ -122,7 +122,7 @@ static int packed_reload(refdb_fs_backend *backend)
...
@@ -122,7 +122,7 @@ static int packed_reload(refdb_fs_backend *backend)
*/
*/
if
(
error
<=
0
)
{
if
(
error
<=
0
)
{
if
(
error
==
GIT_ENOTFOUND
)
{
if
(
error
==
GIT_ENOTFOUND
)
{
git_sortedcache_clear
(
backend
->
refcache
,
true
);
GIT_UNUSED
(
git_sortedcache_clear
(
backend
->
refcache
,
true
)
);
git_error_clear
();
git_error_clear
();
error
=
0
;
error
=
0
;
}
}
...
@@ -131,7 +131,7 @@ static int packed_reload(refdb_fs_backend *backend)
...
@@ -131,7 +131,7 @@ static int packed_reload(refdb_fs_backend *backend)
/* At this point, refresh the packed refs from the loaded buffer. */
/* At this point, refresh the packed refs from the loaded buffer. */
git_sortedcache_clear
(
backend
->
refcache
,
false
);
GIT_UNUSED
(
git_sortedcache_clear
(
backend
->
refcache
,
false
)
);
scan
=
(
char
*
)
packedrefs
.
ptr
;
scan
=
(
char
*
)
packedrefs
.
ptr
;
eof
=
scan
+
packedrefs
.
size
;
eof
=
scan
+
packedrefs
.
size
;
...
@@ -219,7 +219,7 @@ static int packed_reload(refdb_fs_backend *backend)
...
@@ -219,7 +219,7 @@ static int packed_reload(refdb_fs_backend *backend)
parse_failed
:
parse_failed
:
git_error_set
(
GIT_ERROR_REFERENCE
,
"corrupted packed references file"
);
git_error_set
(
GIT_ERROR_REFERENCE
,
"corrupted packed references file"
);
git_sortedcache_clear
(
backend
->
refcache
,
false
);
GIT_UNUSED
(
git_sortedcache_clear
(
backend
->
refcache
,
false
)
);
git_sortedcache_wunlock
(
backend
->
refcache
);
git_sortedcache_wunlock
(
backend
->
refcache
);
git_buf_dispose
(
&
packedrefs
);
git_buf_dispose
(
&
packedrefs
);
...
...
src/sortedcache.h
View file @
efc4e7e5
...
@@ -58,7 +58,7 @@ typedef struct {
...
@@ -58,7 +58,7 @@ typedef struct {
* may be NULL. The cache makes it easy to load this and check
* may be NULL. The cache makes it easy to load this and check
* if it has been modified since the last load and/or write.
* if it has been modified since the last load and/or write.
*/
*/
int
git_sortedcache_new
(
GIT_WARN_UNUSED_RESULT
int
git_sortedcache_new
(
git_sortedcache
**
out
,
git_sortedcache
**
out
,
size_t
item_path_offset
,
/* use offsetof(struct, path-field) macro */
size_t
item_path_offset
,
/* use offsetof(struct, path-field) macro */
git_sortedcache_free_item_fn
free_item
,
git_sortedcache_free_item_fn
free_item
,
...
@@ -71,7 +71,7 @@ int git_sortedcache_new(
...
@@ -71,7 +71,7 @@ int git_sortedcache_new(
* - `copy_item` can be NULL to just use memcpy
* - `copy_item` can be NULL to just use memcpy
* - if `lock`, grabs read lock on `src` during copy and releases after
* - if `lock`, grabs read lock on `src` during copy and releases after
*/
*/
int
git_sortedcache_copy
(
GIT_WARN_UNUSED_RESULT
int
git_sortedcache_copy
(
git_sortedcache
**
out
,
git_sortedcache
**
out
,
git_sortedcache
*
src
,
git_sortedcache
*
src
,
bool
lock
,
bool
lock
,
...
@@ -100,7 +100,7 @@ const char *git_sortedcache_path(git_sortedcache *sc);
...
@@ -100,7 +100,7 @@ const char *git_sortedcache_path(git_sortedcache *sc);
*/
*/
/* Lock sortedcache for write */
/* Lock sortedcache for write */
int
git_sortedcache_wlock
(
git_sortedcache
*
sc
);
GIT_WARN_UNUSED_RESULT
int
git_sortedcache_wlock
(
git_sortedcache
*
sc
);
/* Unlock sorted cache when done with write */
/* Unlock sorted cache when done with write */
void
git_sortedcache_wunlock
(
git_sortedcache
*
sc
);
void
git_sortedcache_wunlock
(
git_sortedcache
*
sc
);
...
@@ -120,7 +120,8 @@ void git_sortedcache_wunlock(git_sortedcache *sc);
...
@@ -120,7 +120,8 @@ void git_sortedcache_wunlock(git_sortedcache *sc);
*
*
* @return 0 if up-to-date, 1 if out-of-date, <0 on error
* @return 0 if up-to-date, 1 if out-of-date, <0 on error
*/
*/
int
git_sortedcache_lockandload
(
git_sortedcache
*
sc
,
git_buf
*
buf
);
GIT_WARN_UNUSED_RESULT
int
git_sortedcache_lockandload
(
git_sortedcache
*
sc
,
git_buf
*
buf
);
/* Refresh file timestamp after write completes
/* Refresh file timestamp after write completes
* You should already be holding the write lock when you call this.
* You should already be holding the write lock when you call this.
...
@@ -132,12 +133,13 @@ void git_sortedcache_updated(git_sortedcache *sc);
...
@@ -132,12 +133,13 @@ void git_sortedcache_updated(git_sortedcache *sc);
* If `wlock` is true, grabs write lock and releases when done, otherwise
* If `wlock` is true, grabs write lock and releases when done, otherwise
* you should already be holding a write lock when you call this.
* you should already be holding a write lock when you call this.
*/
*/
int
git_sortedcache_clear
(
git_sortedcache
*
sc
,
bool
wlock
);
GIT_WARN_UNUSED_RESULT
int
git_sortedcache_clear
(
git_sortedcache
*
sc
,
bool
wlock
);
/* Find and/or insert item, returning pointer to item data.
/* Find and/or insert item, returning pointer to item data.
* You should already be holding the write lock when you call this.
* You should already be holding the write lock when you call this.
*/
*/
int
git_sortedcache_upsert
(
GIT_WARN_UNUSED_RESULT
int
git_sortedcache_upsert
(
void
**
out
,
git_sortedcache
*
sc
,
const
char
*
key
);
void
**
out
,
git_sortedcache
*
sc
,
const
char
*
key
);
/* Removes entry at pos from cache
/* Removes entry at pos from cache
...
@@ -155,7 +157,7 @@ int git_sortedcache_remove(git_sortedcache *sc, size_t pos);
...
@@ -155,7 +157,7 @@ int git_sortedcache_remove(git_sortedcache *sc, size_t pos);
*/
*/
/* Lock sortedcache for read */
/* Lock sortedcache for read */
int
git_sortedcache_rlock
(
git_sortedcache
*
sc
);
GIT_WARN_UNUSED_RESULT
int
git_sortedcache_rlock
(
git_sortedcache
*
sc
);
/* Unlock sorted cache when done with read */
/* Unlock sorted cache when done with read */
void
git_sortedcache_runlock
(
git_sortedcache
*
sc
);
void
git_sortedcache_runlock
(
git_sortedcache
*
sc
);
...
...
src/vector.h
View file @
efc4e7e5
...
@@ -26,11 +26,13 @@ typedef struct git_vector {
...
@@ -26,11 +26,13 @@ typedef struct git_vector {
#define GIT_VECTOR_INIT {0}
#define GIT_VECTOR_INIT {0}
int
git_vector_init
(
git_vector
*
v
,
size_t
initial_size
,
git_vector_cmp
cmp
);
GIT_WARN_UNUSED_RESULT
int
git_vector_init
(
git_vector
*
v
,
size_t
initial_size
,
git_vector_cmp
cmp
);
void
git_vector_free
(
git_vector
*
v
);
void
git_vector_free
(
git_vector
*
v
);
void
git_vector_free_deep
(
git_vector
*
v
);
/* free each entry and self */
void
git_vector_free_deep
(
git_vector
*
v
);
/* free each entry and self */
void
git_vector_clear
(
git_vector
*
v
);
void
git_vector_clear
(
git_vector
*
v
);
int
git_vector_dup
(
git_vector
*
v
,
const
git_vector
*
src
,
git_vector_cmp
cmp
);
GIT_WARN_UNUSED_RESULT
int
git_vector_dup
(
git_vector
*
v
,
const
git_vector
*
src
,
git_vector_cmp
cmp
);
void
git_vector_swap
(
git_vector
*
a
,
git_vector
*
b
);
void
git_vector_swap
(
git_vector
*
a
,
git_vector
*
b
);
int
git_vector_size_hint
(
git_vector
*
v
,
size_t
size_hint
);
int
git_vector_size_hint
(
git_vector
*
v
,
size_t
size_hint
);
...
...
src/win32/path_w32.h
View file @
efc4e7e5
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
#define INCLUDE_win32_path_w32_h__
#define INCLUDE_win32_path_w32_h__
#include "common.h"
#include "common.h"
#include "vector.h"
/**
/**
* Create a Win32 path (in UCS-2 format) from a UTF-8 string. If the given
* Create a Win32 path (in UCS-2 format) from a UTF-8 string. If the given
...
...
tests/core/sha1.c
View file @
efc4e7e5
...
@@ -52,7 +52,7 @@ void test_core_sha1__detect_collision_attack(void)
...
@@ -52,7 +52,7 @@ void test_core_sha1__detect_collision_attack(void)
git_oid
oid
,
expected
;
git_oid
oid
,
expected
;
#ifdef GIT_SHA1_COLLISIONDETECT
#ifdef GIT_SHA1_COLLISIONDETECT
GIT_UNUSED
(
expected
);
GIT_UNUSED
(
&
expected
);
cl_git_fail
(
sha1_file
(
&
oid
,
FIXTURE_DIR
"/shattered-1.pdf"
));
cl_git_fail
(
sha1_file
(
&
oid
,
FIXTURE_DIR
"/shattered-1.pdf"
));
cl_assert_equal_s
(
"SHA1 collision attack detected"
,
git_error_last
()
->
message
);
cl_assert_equal_s
(
"SHA1 collision attack detected"
,
git_error_last
()
->
message
);
#else
#else
...
...
tests/core/sortedcache.c
View file @
efc4e7e5
...
@@ -54,7 +54,7 @@ void test_core_sortedcache__name_only(void)
...
@@ -54,7 +54,7 @@ void test_core_sortedcache__name_only(void)
cl_assert_equal_i
(
cl_assert_equal_i
(
GIT_ENOTFOUND
,
git_sortedcache_lookup_index
(
&
pos
,
sc
,
"abc"
));
GIT_ENOTFOUND
,
git_sortedcache_lookup_index
(
&
pos
,
sc
,
"abc"
));
git_sortedcache_clear
(
sc
,
true
);
cl_git_pass
(
git_sortedcache_clear
(
sc
,
true
)
);
cl_assert_equal_sz
(
0
,
git_sortedcache_entrycount
(
sc
));
cl_assert_equal_sz
(
0
,
git_sortedcache_entrycount
(
sc
));
cl_assert
(
git_sortedcache_entry
(
sc
,
0
)
==
NULL
);
cl_assert
(
git_sortedcache_entry
(
sc
,
0
)
==
NULL
);
...
@@ -154,7 +154,7 @@ void test_core_sortedcache__in_memory(void)
...
@@ -154,7 +154,7 @@ void test_core_sortedcache__in_memory(void)
cl_assert_equal_i
(
0
,
free_count
);
cl_assert_equal_i
(
0
,
free_count
);
git_sortedcache_clear
(
sc
,
true
);
cl_git_pass
(
git_sortedcache_clear
(
sc
,
true
)
);
cl_assert_equal_i
(
5
,
free_count
);
cl_assert_equal_i
(
5
,
free_count
);
...
@@ -247,7 +247,7 @@ static void sortedcache_test_reload(git_sortedcache *sc)
...
@@ -247,7 +247,7 @@ static void sortedcache_test_reload(git_sortedcache *sc)
cl_assert
(
git_sortedcache_lockandload
(
sc
,
&
buf
)
>
0
);
cl_assert
(
git_sortedcache_lockandload
(
sc
,
&
buf
)
>
0
);
git_sortedcache_clear
(
sc
,
false
);
/* clear once we already have lock */
cl_git_pass
(
git_sortedcache_clear
(
sc
,
false
)
);
/* clear once we already have lock */
for
(
scan
=
buf
.
ptr
;
*
scan
;
scan
=
after
+
1
)
{
for
(
scan
=
buf
.
ptr
;
*
scan
;
scan
=
after
+
1
)
{
int
val
=
strtol
(
scan
,
&
after
,
0
);
int
val
=
strtol
(
scan
,
&
after
,
0
);
...
...
tests/core/vector.c
View file @
efc4e7e5
...
@@ -8,7 +8,7 @@ void test_core_vector__0(void)
...
@@ -8,7 +8,7 @@ void test_core_vector__0(void)
{
{
git_vector
x
;
git_vector
x
;
int
i
;
int
i
;
git_vector_init
(
&
x
,
1
,
NULL
);
cl_git_pass
(
git_vector_init
(
&
x
,
1
,
NULL
)
);
for
(
i
=
0
;
i
<
10
;
++
i
)
{
for
(
i
=
0
;
i
<
10
;
++
i
)
{
git_vector_insert
(
&
x
,
(
void
*
)
0xabc
);
git_vector_insert
(
&
x
,
(
void
*
)
0xabc
);
}
}
...
@@ -21,7 +21,7 @@ void test_core_vector__1(void)
...
@@ -21,7 +21,7 @@ void test_core_vector__1(void)
{
{
git_vector
x
;
git_vector
x
;
/* make initial capacity exact for our insertions. */
/* make initial capacity exact for our insertions. */
git_vector_init
(
&
x
,
3
,
NULL
);
cl_git_pass
(
git_vector_init
(
&
x
,
3
,
NULL
)
);
git_vector_insert
(
&
x
,
(
void
*
)
0xabc
);
git_vector_insert
(
&
x
,
(
void
*
)
0xabc
);
git_vector_insert
(
&
x
,
(
void
*
)
0xdef
);
git_vector_insert
(
&
x
,
(
void
*
)
0xdef
);
git_vector_insert
(
&
x
,
(
void
*
)
0x123
);
git_vector_insert
(
&
x
,
(
void
*
)
0x123
);
...
@@ -76,7 +76,7 @@ void test_core_vector__3(void)
...
@@ -76,7 +76,7 @@ void test_core_vector__3(void)
{
{
git_vector
x
;
git_vector
x
;
intptr_t
i
;
intptr_t
i
;
git_vector_init
(
&
x
,
1
,
&
compare_them
);
cl_git_pass
(
git_vector_init
(
&
x
,
1
,
&
compare_them
)
);
for
(
i
=
0
;
i
<
10
;
i
+=
2
)
{
for
(
i
=
0
;
i
<
10
;
i
+=
2
)
{
git_vector_insert_sorted
(
&
x
,
(
void
*
)(
i
+
1
),
NULL
);
git_vector_insert_sorted
(
&
x
,
(
void
*
)(
i
+
1
),
NULL
);
...
@@ -99,7 +99,7 @@ void test_core_vector__4(void)
...
@@ -99,7 +99,7 @@ void test_core_vector__4(void)
{
{
git_vector
x
;
git_vector
x
;
intptr_t
i
;
intptr_t
i
;
git_vector_init
(
&
x
,
1
,
&
compare_them
);
cl_git_pass
(
git_vector_init
(
&
x
,
1
,
&
compare_them
)
);
for
(
i
=
0
;
i
<
10
;
i
+=
2
)
{
for
(
i
=
0
;
i
<
10
;
i
+=
2
)
{
git_vector_insert_sorted
(
&
x
,
(
void
*
)(
i
+
1
),
NULL
);
git_vector_insert_sorted
(
&
x
,
(
void
*
)(
i
+
1
),
NULL
);
...
@@ -163,7 +163,7 @@ void test_core_vector__5(void)
...
@@ -163,7 +163,7 @@ void test_core_vector__5(void)
git_vector
x
;
git_vector
x
;
int
i
;
int
i
;
git_vector_init
(
&
x
,
1
,
&
compare_structs
);
cl_git_pass
(
git_vector_init
(
&
x
,
1
,
&
compare_structs
)
);
for
(
i
=
0
;
i
<
10
;
i
+=
2
)
for
(
i
=
0
;
i
<
10
;
i
+=
2
)
git_vector_insert_sorted
(
&
x
,
alloc_struct
(
i
),
&
merge_structs
);
git_vector_insert_sorted
(
&
x
,
alloc_struct
(
i
),
&
merge_structs
);
...
@@ -205,7 +205,7 @@ void test_core_vector__remove_matching(void)
...
@@ -205,7 +205,7 @@ void test_core_vector__remove_matching(void)
size_t
i
;
size_t
i
;
void
*
compare
;
void
*
compare
;
git_vector_init
(
&
x
,
1
,
NULL
);
cl_git_pass
(
git_vector_init
(
&
x
,
1
,
NULL
)
);
git_vector_insert
(
&
x
,
(
void
*
)
0x001
);
git_vector_insert
(
&
x
,
(
void
*
)
0x001
);
cl_assert
(
x
.
length
==
1
);
cl_assert
(
x
.
length
==
1
);
...
...
tests/fetchhead/nonetwork.c
View file @
efc4e7e5
...
@@ -82,7 +82,7 @@ void test_fetchhead_nonetwork__write(void)
...
@@ -82,7 +82,7 @@ void test_fetchhead_nonetwork__write(void)
int
equals
=
0
;
int
equals
=
0
;
size_t
i
;
size_t
i
;
git_vector_init
(
&
fetchhead_vector
,
6
,
NULL
);
cl_git_pass
(
git_vector_init
(
&
fetchhead_vector
,
6
,
NULL
)
);
cl_set_cleanup
(
&
cleanup_repository
,
"./test1"
);
cl_set_cleanup
(
&
cleanup_repository
,
"./test1"
);
cl_git_pass
(
git_repository_init
(
&
g_repo
,
"./test1"
,
0
));
cl_git_pass
(
git_repository_init
(
&
g_repo
,
"./test1"
,
0
));
...
...
tests/index/addall.c
View file @
efc4e7e5
...
@@ -318,11 +318,9 @@ void test_index_addall__files_in_folders(void)
...
@@ -318,11 +318,9 @@ void test_index_addall__files_in_folders(void)
void
test_index_addall__hidden_files
(
void
)
void
test_index_addall__hidden_files
(
void
)
{
{
#ifdef GIT_WIN32
git_index
*
index
;
git_index
*
index
;
GIT_UNUSED
(
index
);
#ifdef GIT_WIN32
addall_create_test_repo
(
true
);
addall_create_test_repo
(
true
);
cl_git_pass
(
git_repository_index
(
&
index
,
g_repo
));
cl_git_pass
(
git_repository_index
(
&
index
,
g_repo
));
...
...
tests/index/bypath.c
View file @
efc4e7e5
...
@@ -49,13 +49,10 @@ void test_index_bypath__add_submodule_unregistered(void)
...
@@ -49,13 +49,10 @@ void test_index_bypath__add_submodule_unregistered(void)
void
test_index_bypath__add_hidden
(
void
)
void
test_index_bypath__add_hidden
(
void
)
{
{
#ifdef GIT_WIN32
const
git_index_entry
*
entry
;
const
git_index_entry
*
entry
;
bool
hidden
;
bool
hidden
;
GIT_UNUSED
(
entry
);
GIT_UNUSED
(
hidden
);
#ifdef GIT_WIN32
cl_git_mkfile
(
"submod2/hidden_file"
,
"you can't see me"
);
cl_git_mkfile
(
"submod2/hidden_file"
,
"you can't see me"
);
cl_git_pass
(
git_win32__hidden
(
&
hidden
,
"submod2/hidden_file"
));
cl_git_pass
(
git_win32__hidden
(
&
hidden
,
"submod2/hidden_file"
));
...
...
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