git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix how for-each-ref handles broken loose references
@ 2015-06-01 15:53 Michael Haggerty
  2015-06-01 15:53 ` [PATCH 1/3] t6301: new tests of for-each-ref error handling Michael Haggerty
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michael Haggerty @ 2015-06-01 15:53 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Anders Kaseorg, Stefan Beller, Jeff King, git, Michael Haggerty

Currently, "git for-each-ref" fails to handle REF_ISBROKEN references
correctly, treating them instead as valid references that point at
NULL_SHA1. Sometimes this makes for-each-ref emit the wrong error
message; sometimes it even appears to complete successfully.

Instead, emit warnings for broken references but otherwise ignore
them. Also, add special-case code to defend against an actual
NULL_SHA1 in a loose reference file being treated as valid. (We've
seen that problem on our servers before, probably caused by the Ruby
Git client that we used to use.)

This patch series was prepared against "maint" as it might be suitable
for that branch, but it also applies cleanly against "master".

This patch series is also available from my GitHub account [1], as
branch for-each-ref-errors.

[1] https://github.com/mhagger/git

Michael Haggerty (3):
  t6301: new tests of for-each-ref error handling
  for-each-ref: report broken references correctly
  read_loose_refs(): treat NULL_SHA1 loose references as broken

 builtin/for-each-ref.c         |  5 +++++
 refs.c                         |  7 +++++++
 t/t6301-for-each-ref-errors.sh | 45 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 57 insertions(+)
 create mode 100755 t/t6301-for-each-ref-errors.sh

-- 
2.1.4

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

end of thread, other threads:[~2015-06-02 15:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-01 15:53 [PATCH 0/3] Fix how for-each-ref handles broken loose references Michael Haggerty
2015-06-01 15:53 ` [PATCH 1/3] t6301: new tests of for-each-ref error handling Michael Haggerty
2015-06-01 16:08   ` Jeff King
2015-06-01 17:33     ` Junio C Hamano
2015-06-02 15:46     ` Michael Haggerty
2015-06-01 15:53 ` [PATCH 2/3] for-each-ref: report broken references correctly Michael Haggerty
2015-06-01 15:53 ` [PATCH 3/3] read_loose_refs(): treat NULL_SHA1 loose references as broken Michael Haggerty

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).