Repository: folke/lazy.nvim
File: lua/lazy/manage/task/git.lua (Lua)

Code before:
      "--decorate",
      "--date=short",
      "--color=never",
      "--no-show-signature",
    }

    if opts.updated then
      table.insert(args, self.plugin._.updated.from .. ".." .. (self.plugin._.updated.to or "HEAD"))
    elseif opts.check then
      local info = assert(Git.info(self.plugin.dir))
      local target = assert(Git.get_target(self.plugin))
      if not target.commit then
        for k, v in pairs(target) do
          error(k .. " '" .. v .. "' not found")
        end
        error("no target commit found")
      end
      assert(target.commit, self.plugin.name .. " " .. target.branch)
      if Git.eq(info, target) and Config.options.checker.check_pinned then
        local last_commit = Git.get_commit(self.plugin.dir, target.branch, true)
        if not Git.eq(info, { commit = last_commit }) then
          self.plugin._.outdated = true
        end
      else
        self.plugin._.updates = { from = info, to = target }
      end
      table.insert(args, info.commit .. ".." .. target.commit)
    else
      vim.list_extend(args, opts.args or Config.options.git.log)
    end

    self:spawn("git", {
      args = args,
      cwd = self.plugin.dir,
    })
  end,
}

M.clone = {
  skip = function(plugin)
    return plugin._.installed or plugin._.is_local
  end,
  run = function(self)
    local args = {
      "clone",
      self.plugin.url,
    }

    if Config.options.git.filter then
      args[#args + 1] = "--filter=blob:none"
    end

Review comment (bug):
I think you got your `if/then` wrong again here :)

When we are at the target, and `check_pinne=false`, it will now always show there's updates.

Move the `check_pinned` check inside the `if Git.eq(info, target) then` to make it work


Code after:
      "--decorate",
      "--date=short",
      "--color=never",
      "--no-show-signature",
    }

    if opts.updated then
      table.insert(args, self.plugin._.updated.from .. ".." .. (self.plugin._.updated.to or "HEAD"))
    elseif opts.check then
      local info = assert(Git.info(self.plugin.dir))
      local target = assert(Git.get_target(self.plugin))
      if not target.commit then
        for k, v in pairs(target) do
          error(k .. " '" .. v .. "' not found")
        end
        error("no target commit found")
      end
      assert(target.commit, self.plugin.name .. " " .. target.branch)
      if Git.eq(info, target) then
        if Config.options.checker.check_pinned then
          local last_commit = Git.get_commit(self.plugin.dir, target.branch, true)
          if not Git.eq(info, { commit = last_commit }) then
            self.plugin._.outdated = true
          end
        end
      else
        self.plugin._.updates = { from = info, to = target }
      end
      table.insert(args, info.commit .. ".." .. target.commit)
    else
      vim.list_extend(args, opts.args or Config.options.git.log)
    end

    self:spawn("git", {
      args = args,
      cwd = self.plugin.dir,
    })
  end,
}

M.clone = {
  skip = function(plugin)
    return plugin._.installed or plugin._.is_local
  end,
  run = function(self)
    local args = {
      "clone",
      self.plugin.url,
    }

    if Config.options.git.filter then