From: Ronnie Sahlberg <sahlberg@google.com>
To: git@vger.kernel.org
Cc: mhagger@alum.mit.edu, Ronnie Sahlberg <sahlberg@google.com>
Subject: [PATCH v2 0/2] add a reflog_exists and delete_reflog abstraction
Date: Tue, 6 May 2014 15:45:51 -0700 [thread overview]
Message-ID: <1399416353-31817-1-git-send-email-sahlberg@google.com> (raw)
This is a series adds two new functions to try to hide the reflog
implementation details from the callers in checkout.c and reflog.c.
It adds new functions to test if a reflog exists and to delete it, thus
allowing checkout.c to perform this if-test-then-delete operation without
having to know the internal implementation of reflogs (i.e. that they are files
that live under .git/logs)
Additionally we change checkout.c to use ref_exists instead of file_exists
when checking for ref existence. This fixes a bug when checkout could delete
a valid reflog file if the branch was a packed ref. The tests have been updated
to test for this bug.
Version 2:
- Typos and fixes suggested by mhagger.
- Break the checkout-deletes reflog bugfix out into a separate patch.
Ronnie Sahlberg (2):
refs.c: add new functions reflog_exists and delete_reflog
checkout.c: use ref_exists instead of file_exist
builtin/checkout.c | 8 ++------
builtin/reflog.c | 2 +-
refs.c | 21 +++++++++++++++------
refs.h | 6 ++++++
t/t1410-reflog.sh | 8 ++++++++
5 files changed, 32 insertions(+), 13 deletions(-)
--
2.0.0.rc1.354.g7561c2b.dirty
next reply other threads:[~2014-05-06 22:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 22:45 Ronnie Sahlberg [this message]
2014-05-06 22:45 ` [PATCH v2 1/2] refs.c: add new functions reflog_exists and delete_reflog Ronnie Sahlberg
2014-05-06 22:45 ` [PATCH v2 2/2] checkout.c: use ref_exists instead of file_exist Ronnie Sahlberg
2014-05-07 11:56 ` [PATCH v2 0/2] add a reflog_exists and delete_reflog abstraction Michael Haggerty
2014-05-07 20:17 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1399416353-31817-1-git-send-email-sahlberg@google.com \
--to=sahlberg@google.com \
--cc=git@vger.kernel.org \
--cc=mhagger@alum.mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).