Coverage Report

Created: 2024-09-08 06:23

/src/git/read-cache.h
Line
Count
Source (jump to first uncovered line)
1
#ifndef READ_CACHE_H
2
#define READ_CACHE_H
3
4
#include "read-cache-ll.h"
5
#include "object.h"
6
#include "pathspec.h"
7
8
static inline unsigned int ce_mode_from_stat(const struct cache_entry *ce,
9
               unsigned int mode)
10
0
{
11
0
  extern int trust_executable_bit, has_symlinks;
12
0
  if (!has_symlinks && S_ISREG(mode) &&
13
0
      ce && S_ISLNK(ce->ce_mode))
14
0
    return ce->ce_mode;
15
0
  if (!trust_executable_bit && S_ISREG(mode)) {
16
0
    if (ce && S_ISREG(ce->ce_mode))
17
0
      return ce->ce_mode;
18
0
    return create_ce_mode(0666);
19
0
  }
20
0
  return create_ce_mode(mode);
21
0
}
Unexecuted instantiation: add.c:ce_mode_from_stat
Unexecuted instantiation: checkout.c:ce_mode_from_stat
Unexecuted instantiation: commit.c:ce_mode_from_stat
Unexecuted instantiation: ls-files.c:ce_mode_from_stat
Unexecuted instantiation: rm.c:ce_mode_from_stat
Unexecuted instantiation: stash.c:ce_mode_from_stat
Unexecuted instantiation: submodule--helper.c:ce_mode_from_stat
Unexecuted instantiation: update-index.c:ce_mode_from_stat
Unexecuted instantiation: apply.c:ce_mode_from_stat
Unexecuted instantiation: blame.c:ce_mode_from_stat
Unexecuted instantiation: diff-lib.c:ce_mode_from_stat
Unexecuted instantiation: pathspec.c:ce_mode_from_stat
Unexecuted instantiation: preload-index.c:ce_mode_from_stat
Unexecuted instantiation: read-cache.c:ce_mode_from_stat
Unexecuted instantiation: resolve-undo.c:ce_mode_from_stat
Unexecuted instantiation: revision.c:ce_mode_from_stat
Unexecuted instantiation: unpack-trees.c:ce_mode_from_stat
Unexecuted instantiation: wt-status.c:ce_mode_from_stat
22
23
static inline int ce_to_dtype(const struct cache_entry *ce)
24
0
{
25
0
  unsigned ce_mode = ntohl(ce->ce_mode);
26
0
  if (S_ISREG(ce_mode))
27
0
    return DT_REG;
28
0
  else if (S_ISDIR(ce_mode) || S_ISGITLINK(ce_mode))
29
0
    return DT_DIR;
30
0
  else if (S_ISLNK(ce_mode))
31
0
    return DT_LNK;
32
0
  else
33
0
    return DT_UNKNOWN;
34
0
}
Unexecuted instantiation: add.c:ce_to_dtype
Unexecuted instantiation: checkout.c:ce_to_dtype
Unexecuted instantiation: commit.c:ce_to_dtype
Unexecuted instantiation: ls-files.c:ce_to_dtype
Unexecuted instantiation: rm.c:ce_to_dtype
Unexecuted instantiation: stash.c:ce_to_dtype
Unexecuted instantiation: submodule--helper.c:ce_to_dtype
Unexecuted instantiation: update-index.c:ce_to_dtype
Unexecuted instantiation: apply.c:ce_to_dtype
Unexecuted instantiation: blame.c:ce_to_dtype
Unexecuted instantiation: diff-lib.c:ce_to_dtype
Unexecuted instantiation: pathspec.c:ce_to_dtype
Unexecuted instantiation: preload-index.c:ce_to_dtype
Unexecuted instantiation: read-cache.c:ce_to_dtype
Unexecuted instantiation: resolve-undo.c:ce_to_dtype
Unexecuted instantiation: revision.c:ce_to_dtype
Unexecuted instantiation: unpack-trees.c:ce_to_dtype
Unexecuted instantiation: wt-status.c:ce_to_dtype
35
36
static inline int ce_path_match(struct index_state *istate,
37
        const struct cache_entry *ce,
38
        const struct pathspec *pathspec,
39
        char *seen)
40
0
{
41
0
  return match_pathspec(istate, pathspec, ce->name, ce_namelen(ce), 0, seen,
42
0
            S_ISDIR(ce->ce_mode) || S_ISGITLINK(ce->ce_mode));
43
0
}
Unexecuted instantiation: add.c:ce_path_match
Unexecuted instantiation: checkout.c:ce_path_match
Unexecuted instantiation: commit.c:ce_path_match
Unexecuted instantiation: ls-files.c:ce_path_match
Unexecuted instantiation: rm.c:ce_path_match
Unexecuted instantiation: stash.c:ce_path_match
Unexecuted instantiation: submodule--helper.c:ce_path_match
Unexecuted instantiation: update-index.c:ce_path_match
Unexecuted instantiation: apply.c:ce_path_match
Unexecuted instantiation: blame.c:ce_path_match
Unexecuted instantiation: diff-lib.c:ce_path_match
Unexecuted instantiation: pathspec.c:ce_path_match
Unexecuted instantiation: preload-index.c:ce_path_match
Unexecuted instantiation: read-cache.c:ce_path_match
Unexecuted instantiation: resolve-undo.c:ce_path_match
Unexecuted instantiation: revision.c:ce_path_match
Unexecuted instantiation: unpack-trees.c:ce_path_match
Unexecuted instantiation: wt-status.c:ce_path_match
44
45
#endif /* READ_CACHE_H */