Skip to content
  • Jeff King's avatar
    git-stash: don't complain when listing in a repo with no stash · 401de405
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Previously, the git-log invocation would complain if a repo
    had not had any stashes created in it yet:
    
    $ git-init
    $ git-stash
    fatal: ambiguous argument 'refs/stash': unknown revision or
      path not in the working tree.
    Use '--' to separate paths from revisions
    
    Instead, we only call git-log if we actually have a
    refs/stash. We could alternatively create the ref when any
    stash command is called, but it's better for the 'list'
    command to not require write access to the repo.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    401de405