def default_branch
      if branch_exists?(@default_settings.fetch(:branch))
        return @default_settings.fetch(:branch)
      end

      execute("git #{git_directory_params} rev-parse HEAD | head -1") do |result|
        return result.data.split(" ")[0] if result.success?
      end
      raise Error, "No branch found. Define one using --branch=<branch>"
    end
def default_branch
      if branch_exists?(@default_settings.fetch(:branch))
        return @default_settings.fetch(:branch)
      end

      execute("git #{git_directory_params} rev-parse HEAD | head -1") do |result|
        return result.data.split(" ")[0] if result.success?
      end
      raise Error, "No branch found. Define one using --branch=<branch>"
    end
In those cases the users havent defined a branch
 We try to define it for him/her by
 1. check if { @default_settings.fetch(:branch) } exists
 1. look at .git/HEAD (basically)