lib/ohloh_scm/git/status.rb in ohloh_scm-4.0.3 vs lib/ohloh_scm/git/status.rb in ohloh_scm-4.0.4
- old
+ new
@@ -6,8 +6,15 @@
def branch?(name = scm.branch_name)
return unless scm_dir_exist?
activity.branches.include?(name)
end
+
+ def default_branch
+ return scm.branch_name_or_default unless exist?
+
+ name = run("git remote show '#{scm.url}' | grep 'HEAD branch' | awk '{print $3}'").strip
+ name.to_s.empty? ? scm.branch_name_or_default : name
+ end
end
end
end