def METHOD_NAME(self, edit):
    # type: (sublime.Edit) -> None
    view = self.view
    file_path = view.file_name()
    if not file_path:
        flash(view, "Cannot stage on unnnamed buffers.")
        return
    if view.is_dirty():
        flash(view, "Cannot stage on unsaved files.")
        return
    raw_diff = self.git("diff", "-U0", file_path)
    if not raw_diff:
        not_tracked_file = self.git("ls-files", file_path).strip() == ""
        if not_tracked_file:
            self.git("add", file_path)
            flash(view, "Staged whole file.")
        else:
            flash(view, "The file is clean.")
        return
    diff = SplittedDiff.from_string(raw_diff)
    assert len(diff.headers) == 1
    try:
        hunks = hunks_touching_selection(diff, view)
    except UnsupportedCombinedDiff:
        flash(view, "Files with merge conflicts are not supported.")
        return
    if not hunks:
        flash(view, "Not on a hunk.")
        return
    patch = format_patch(diff.headers[0].text, hunks)
    self.git("apply", "--cached", "--unidiff-zero", "-", stdin=patch)
    hunk_count = len(hunks)
    flash(view, "Staged {} {}.".format(hunk_count, pluralize("hunk", hunk_count)))