def commit_changes(session, branch, sha1, msg)
    if session.status.lines.any?
      # add before commit because the path can be below a not yet added path
      session.execute("git add --all")
      msg_file = Tempfile.new('message')
      begin
        msg_file << msg
        msg_file.close
        session.execute("git commit -F #{msg_file.path}")
      ensure
        msg_file.close(true)
      end
      # create tag
      session.execute("git tag rim-#{sha1} refs/heads/#{branch}")
    end
  end
def commit_changes(session, branch, sha1, msg)
    if session.status.lines.any?
      # add before commit because the path can be below a not yet added path
      session.execute("git add --all")
      msg_file = Tempfile.new('message')
      begin
        msg_file << msg
        msg_file.close
        session.execute("git commit -F #{msg_file.path}")
      ensure
        msg_file.close(true)
      end
      # create tag
      session.execute("git tag rim-#{sha1} refs/heads/#{branch}")
    end
  end
commit changes to session