version 1.1.1.2, 2013/10/14 07:51:14
|
version 1.1.1.3, 2016/11/01 09:54:32
|
Line 35 sub check_git_status
|
Line 35 sub check_git_status
|
my($fatal_unless_clean, $subdir) = @_; |
my($fatal_unless_clean, $subdir) = @_; |
$subdir = '.' unless defined $subdir; |
$subdir = '.' unless defined $subdir; |
my $status = `cd '$subdir' && git status`; |
my $status = `cd '$subdir' && git status`; |
my $is_clean = $status =~ /\nnothing to commit \(working directory clean\)/; | my $is_clean = $status =~ /\nnothing to commit.+working directory clean/; |
my($cur_branch) = $status =~ /^# On branch (.+)\n/; | my($cur_branch) = $status =~ /^(?:# )?On branch (.+)\n/; |
if ($fatal_unless_clean && !$is_clean) { |
if ($fatal_unless_clean && !$is_clean) { |
if ($subdir eq '.') { |
if ($subdir eq '.') { |
$subdir = ''; |
$subdir = ''; |