From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 2/5] t6050: make sure we test not just commit replacement
Date: Sun, 15 May 2011 12:54:51 -0700 [thread overview]
Message-ID: <1305489294-14341-3-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1305489294-14341-1-git-send-email-gitster@pobox.com>
The replacement mechanism should affect all types of objects not
just commits, so make sure it deals with at least a blob.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
t/t6050-replace.sh | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index ae2194e..5c87f28 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -236,6 +236,20 @@ test_expect_success 'index-pack and replacements' '
git index-pack test-*.pack
'
-#
-#
+test_expect_success 'not just commits' '
+ echo replaced >file &&
+ git add file &&
+ REPLACED=$(git rev-parse :file) &&
+ mv file file.replaced &&
+
+ echo original >file &&
+ git add file &&
+ ORIGINAL=$(git rev-parse :file) &&
+ git update-ref refs/replace/$ORIGINAL $REPLACED &&
+ mv file file.original &&
+
+ git checkout file &&
+ test_cmp file.replaced file
+'
+
test_done
--
1.7.5.1.334.gdfd07
next prev parent reply other threads:[~2011-05-15 19:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-15 19:54 [PATCH 0/5] Updates to replace-object API Junio C Hamano
2011-05-15 19:54 ` [PATCH 1/5] Declare lookup_replace_object() in cache.h, not in commit.h Junio C Hamano
2011-05-15 19:54 ` Junio C Hamano [this message]
2011-05-15 19:54 ` [PATCH 3/5] read_sha1_file(): get rid of read_sha1_file_repl() madness Junio C Hamano
2011-05-15 19:54 ` [PATCH 4/5] inline lookup_replace_object() calls Junio C Hamano
2011-05-15 19:54 ` [PATCH 5/5] read_sha1_file(): allow selective bypassing of replacement mechanism 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=1305489294-14341-3-git-send-email-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/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).