git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix a bug with update-ref "verify" and no oldvalue
@ 2014-12-10 23:47 Michael Haggerty
  2014-12-10 23:47 ` [PATCH 1/2] t1400: add some more tests of "update-ref --stdin"'s verify command Michael Haggerty
  2014-12-10 23:47 ` [PATCH 2/2] update-ref: fix "verify" command with missing <oldvalue> Michael Haggerty
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Haggerty @ 2014-12-10 23:47 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Brad King, Stefan Beller, Jonathan Nieder, Ronnie Sahlberg, git,
	Michael Haggerty

Ever since the --stdin option was added to "git update-ref" in

    c750ba9519 update-ref: support multiple simultaneous updates (2013-09-09)

the "verify" command has been broken. If no <oldvalue> is specified,
the documentation says that the "verify" command will verify that the
reference doesn't currently exist. But in fact, it unconditionally
*deletes* the reference (!)

Hopefully this is not a common usage idiom, but this is nonetheless a
serious bug.

Add some tests for this and related functionality, then fix the bug.

These patches are also available from my GitHub repository [1] as
branch "update-ref-verify-fix-v1".

This fix applies to "maint", for which I think it is appropriate. It
also merges through to "master" with no conflicts, though it conflicts
trivially with "pu".

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

Michael Haggerty (2):
  t1400: add some more tests of "update-ref --stdin"'s verify command
  update-ref: fix "verify" command with missing <oldvalue>

 builtin/update-ref.c  | 14 +++-----
 t/t1400-update-ref.sh | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 97 insertions(+), 9 deletions(-)

-- 
2.1.3

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

end of thread, other threads:[~2014-12-11 16:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-10 23:47 [PATCH 0/2] Fix a bug with update-ref "verify" and no oldvalue Michael Haggerty
2014-12-10 23:47 ` [PATCH 1/2] t1400: add some more tests of "update-ref --stdin"'s verify command Michael Haggerty
2014-12-11  0:10   ` Stefan Beller
2014-12-11 16:19   ` Brad King
2014-12-10 23:47 ` [PATCH 2/2] update-ref: fix "verify" command with missing <oldvalue> Michael Haggerty
2014-12-11  0:21   ` Stefan Beller
2014-12-11 16:19   ` Brad King

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