Class: Overcommit::GitRepo::SubmoduleStatus

Inherits:
Struct
  • Object
show all
Defined in:
lib/overcommit/git_repo.rb

Overview

Struct encapsulating submodule information extracted from the output of ‘git submodule status`

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#describeObject

Returns the value of attribute describe

Returns:

  • (Object)

    the current value of describe



29
30
31
# File 'lib/overcommit/git_repo.rb', line 29

def describe
  @describe
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



29
30
31
# File 'lib/overcommit/git_repo.rb', line 29

def path
  @path
end

#prefixObject

Returns the value of attribute prefix

Returns:

  • (Object)

    the current value of prefix



29
30
31
# File 'lib/overcommit/git_repo.rb', line 29

def prefix
  @prefix
end

#sha1Object

Returns the value of attribute sha1

Returns:

  • (Object)

    the current value of sha1



29
30
31
# File 'lib/overcommit/git_repo.rb', line 29

def sha1
  @sha1
end

Instance Method Details

#merge_conflict?Boolean

Returns whether the submodule reference has a merge conflict

Returns:

  • (Boolean)


43
44
45
# File 'lib/overcommit/git_repo.rb', line 43

def merge_conflict?
  prefix == 'U'
end

#outdated?Boolean

Returns whether the submodule is out of date with the current index, i.e. its checked-out commit differs from that stored in the index of the parent repo

Returns:

  • (Boolean)


38
39
40
# File 'lib/overcommit/git_repo.rb', line 38

def outdated?
  prefix == '+'
end

#uninitialized?Boolean

Returns whether the submodule has not been initialized

Returns:

  • (Boolean)


31
32
33
# File 'lib/overcommit/git_repo.rb', line 31

def uninitialized?
  prefix == '-'
end