diff --git a/lib/updater/git_updater.rb b/lib/updater/git_updater.rb index 5e591090..0afb4336 100644 --- a/lib/updater/git_updater.rb +++ b/lib/updater/git_updater.rb @@ -35,7 +35,7 @@ class GitUpdater < Updater end def has_local_changes? - %x[git diff --exit-code 2>&1] =~ /diff/ ? true : false + %x[git #{repo_directory_arguments()} diff --exit-code 2>&1] =~ /diff/ ? true : false end def reset_head diff --git a/spec/lib/updater/git_updater_spec.rb b/spec/lib/updater/git_updater_spec.rb index c1fc9ae5..0a326158 100644 --- a/spec/lib/updater/git_updater_spec.rb +++ b/spec/lib/updater/git_updater_spec.rb @@ -47,7 +47,7 @@ describe GitUpdater do describe "#has_local_changes?" do after :each do - stub_system_command(@git_updater, /^git diff --exit-code 2>&1/, @stub_value) + stub_system_command(@git_updater, /^git .* diff --exit-code 2>&1/, @stub_value) @git_updater.has_local_changes?.should === @expected end