Re: [PATCH 09/11] ref_transaction_delete(): check that old_sha1 is not null_sha1

2015-02-09 Thread Stefan Beller
On Sun, Feb 8, 2015 at 8:14 AM, Michael Haggerty mhag...@alum.mit.edu wrote:
 It makes no sense to delete a reference that is already known not to
 exist.

 Signed-off-by: Michael Haggerty mhag...@alum.mit.edu

Reviewed-by: Stefan Beller sbel...@google.com
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/11] ref_transaction_delete(): check that old_sha1 is not null_sha1

2015-02-08 Thread Michael Haggerty
It makes no sense to delete a reference that is already known not to
exist.

Signed-off-by: Michael Haggerty mhag...@alum.mit.edu
---
 refs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/refs.c b/refs.c
index 8ab1f8e..85815d7 100644
--- a/refs.c
+++ b/refs.c
@@ -3703,6 +3703,8 @@ int ref_transaction_delete(struct ref_transaction 
*transaction,
   int flags, const char *msg,
   struct strbuf *err)
 {
+   if (old_sha1  is_null_sha1(old_sha1))
+   die(BUG: delete called with old_sha1 set to zeros);
return ref_transaction_update(transaction, refname,
  null_sha1, old_sha1,
  flags, msg, err);
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html