Class: Gitit::Branch

Inherits:
Object
  • Object
show all
Includes:
CommandExecutor
Defined in:
lib/gitit/command_branch.rb

Overview



Instance Attribute Summary collapse

Attributes included from CommandExecutor

#repo

Instance Method Summary collapse

Methods included from CommandExecutor

#execute_command

Constructor Details

#initialize(repo, name) ⇒ Branch





14
15
16
17
# File 'lib/gitit/command_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/command_branch.rb', line 10

def name
  @name
end

Instance Method Details

#valid?Boolean



Returns:

  • (Boolean)


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

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