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



26
27
28
# File 'lib/overcommit/git_repo.rb', line 26

def describe
  @describe
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



26
27
28
# File 'lib/overcommit/git_repo.rb', line 26

def path
  @path
end

#prefixObject

Returns the value of attribute prefix

Returns:

  • (Object)

    the current value of prefix



26
27
28
# File 'lib/overcommit/git_repo.rb', line 26

def prefix
  @prefix
end

#sha1Object

Returns the value of attribute sha1

Returns:

  • (Object)

    the current value of sha1



26
27
28
# File 'lib/overcommit/git_repo.rb', line 26

def sha1
  @sha1
end

Instance Method Details

#merge_conflict?Boolean

Returns whether the submodule reference has a merge conflict

Returns:

  • (Boolean)


40
41
42
# File 'lib/overcommit/git_repo.rb', line 40

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)


35
36
37
# File 'lib/overcommit/git_repo.rb', line 35

def outdated?
  prefix == '+'
end

#uninitialized?Boolean

Returns whether the submodule has not been initialized

Returns:

  • (Boolean)


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

def uninitialized?
  prefix == '-'
end