Class: Gitit::GitBranch

Inherits:
Object
  • Object
show all
Includes:
GitExecutor
Defined in:
lib/gitit/git_branch.rb

Overview



Instance Attribute Summary collapse

Attributes included from GitExecutor

#repo

Instance Method Summary collapse

Methods included from GitExecutor

#execute_command, repo

Constructor Details

#initialize(repo, name) ⇒ GitBranch





14
15
16
17
# File 'lib/gitit/git_branch.rb', line 14

def initialize(repo, name)
  @repo = repo
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/gitit/git_branch.rb', line 10

def name
  @name
end

Instance Method Details

#valid?Boolean



Returns:

  • (Boolean)


21
22
23
24
# File 'lib/gitit/git_branch.rb', line 21

def valid?
  execute_command('diff --cached --no-ext-diff --ignore-submodules --quiet --exit-code')
  $?.exitstatus == 1
end