git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix error message in git-show-ref(1) --exists
@ 2024-01-10 14:15 Toon Claes
  2024-01-10 14:15 ` [PATCH 1/1] builtin/show-ref: treat directory directory as non-existing in --exists Toon Claes
  0 siblings, 1 reply; 8+ messages in thread
From: Toon Claes @ 2024-01-10 14:15 UTC (permalink / raw)
  To: git; +Cc: Toon Claes

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-01-18 19:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-10 14:15 [PATCH 0/1] Fix error message in git-show-ref(1) --exists Toon Claes
2024-01-10 14:15 ` [PATCH 1/1] builtin/show-ref: treat directory directory as non-existing in --exists Toon Claes
2024-01-10 14:36   ` Eric Sunshine
2024-01-10 15:20     ` Toon Claes
2024-01-17  6:29       ` Patrick Steinhardt
2024-01-17 23:07         ` Junio C Hamano
2024-01-18  8:24           ` Toon Claes
2024-01-18 19:19             ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).