Xgit v0.7.1 Xgit.DirCache.Entry View Source

A single file (or stage of a file) in a directory cache.

An entry represents exactly one stage of a file. If a file path is unmerged then multiple instances may appear for the same path name.

Link to this section Summary

Types

Merge status (stage).

Merge status (stage) for matching a remove request. (Includes :all to match any stage.)

t()

A single file (or stage of a file) in a directory cache.

Functions

Compare two entries according to git dir cache entry sort ordering rules.

Return true if this entry struct describes a valid dir cache entry.

Link to this section Types

Link to this type

stage()

View Source
stage() :: 0..3

Merge status (stage).

Link to this type

stage_match()

View Source
stage_match() :: 0..3 | :all

Merge status (stage) for matching a remove request. (Includes :all to match any stage.)

Link to this type

t()

View Source
t() :: %Xgit.DirCache.Entry{
  assume_valid?: boolean(),
  ctime: integer(),
  ctime_ns: non_neg_integer(),
  dev: integer(),
  extended?: boolean(),
  gid: integer(),
  ino: integer(),
  intent_to_add?: boolean(),
  mode: Xgit.FileMode.t(),
  mtime: integer(),
  mtime_ns: non_neg_integer(),
  name: Xgit.FilePath.t(),
  object_id: Xgit.ObjectId.t(),
  size: non_neg_integer(),
  skip_worktree?: boolean(),
  stage: stage(),
  uid: integer()
}

A single file (or stage of a file) in a directory cache.

An entry represents exactly one stage of a file. If a file path is unmerged then multiple instances may appear for the same path name.

Consult the documentation for git index file format for a more detailed description of each item.

Struct Members

  • name: (FilePath.t) entry path name, relative to top-level directory (without leading slash)
  • stage: (0..3) merge status
  • object_id: (ObjectId.t) SHA-1 for the represented object
  • mode: (FileMode.t)
  • size: (integer) on-disk size, possibly truncated to 32 bits
  • ctime: (integer) the last time the file's metadata changed
  • ctime_ns: (integer) nanosecond fraction of ctime (if available)
  • mtime: (integer) the last time a file's contents changed
  • mtime_ns: (integer) nanosecond fractino of mtime (if available)
  • dev: (integer)
  • ino: (integer)
  • uid: (integer)
  • gid: (integer)
  • assume_valid?: (boolean)
  • extended?: (boolean)
  • skip_worktree?: (boolean)
  • intent_to_add?: (boolean)

Link to this section Functions

Link to this function

compare(entry1, entry2)

View Source
compare(entry1 :: t() | nil, entry2 :: t()) ::
  Xgit.Util.Comparison.result()

Compare two entries according to git dir cache entry sort ordering rules.

For this purpose, only the following fields are considered (in this priority order):

  • :name
  • :stage

Return Value

  • :lt if entry1 sorts before entry2.
  • :eq if they are the same.
  • :gt if entry1 sorts after entry2.
Link to this function

valid?(entry)

View Source
valid?(entry :: any()) :: boolean()

Return true if this entry struct describes a valid dir cache entry.