[PATCH 0/1] Fix error message in git-show-ref(1) --exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



References can validly contain forward slashes in their name. With the ref files
backend, these are stored as a directory tree. This means when you look up a
reference, you might find a directory where you expected a file.

This causes the option --exists, recently added to git-show-ref(1), to return
the following error:

    error: failed to look up reference: Is a directory

Other backends, like reftables, might store refs with forward slashes
differently. So they will not encounter the same error.

To make the error consistent across refs backend implementations, and to be more
clear to user, hide the error about having found a directory as a generic error:

    error: reference does not exist

Toon Claes (1):
  builtin/show-ref: treat directory directory as non-existing in
    --exists

 builtin/show-ref.c  | 2 +-
 t/t1403-show-ref.sh | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


base-commit: a54a84b333adbecf7bc4483c0e36ed5878cac17b
--
2.42.1




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux