lib/git_cli.rb in git_cli-0.9.0 vs lib/git_cli.rb in git_cli-0.11.0
- old
+ new
@@ -44,10 +44,13 @@
module Common
include Antrapol::ToolRack::ConditionUtils
include Antrapol::ToolRack::ExceptionUtils
def os_exec(path, &block)
+
+ Gvcs::Config.instance.command_output.puts("Git command : #{path}") if Gvcs::Config.instance.is_show_vcs_command?
+
# redirect stderr to stdout
path = "#{path} 2>&1"
res = Antrapol::ToolRack::ProcessUtilsEngine.exec(path)
if block
# $?.exitstatus => error codes
@@ -219,10 +222,27 @@
repo.support_push if v.keys.include?("push")
add_repos(repo)
end
end
+ def repos
+ if @repos.nil? or @repos.empty?
+ load_remote_to_repos
+ end
+ @repos
+ end
+
+ def is_clean?
+ nd, nf = new_files
+ md, mf = modified_files
+ dd, df = deleted_files
+ sd, sf = staged_files
+
+ (nd.length == 0 and nf.length == 0 and md.length == 0 and mf.length == 0 and dd.length == 0 and df.length == 0 and sd.length == 0 and sf.length == 0)
+ end
+ alias_method :clean?, :is_clean?
+
end # Gvcs::Workspace
class Gvcs::Repository
@@ -247,16 +267,18 @@
@fetch = true
end
def is_fetch_supported?
@fetch
end
+ alias_method :can_fetch?, :is_fetch_supported?
def support_push
@push = true
end
def is_push_supported?
@push
end
+ alias_method :can_push?, :is_push_supported?
end # repository
end