git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/5] t6050: make sure we test not just commit replacement

From
Junio C Hamano <gitster@pobox.com>
Date
May 15, 2011, 19:54 UTC
Message-ID
<1305489294-14341-3-git-send-email-gitster@pobox.com>
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
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “Updates to replace-object API”
  1. 0/5 Updates to replace-object APIJunio C Hamano, May 15, 2011
  2. 1/5 Declare lookup_replace_object() in cache.h, not in commit.hJunio C Hamano, May 15, 2011
  3. 2/5 t6050: make sure we test not just commit replacementJunio C Hamano, May 15, 2011
  4. 3/5 read_sha1_file(): get rid of read_sha1_file_repl() madnessJunio C Hamano, May 15, 2011
  5. 4/5 inline lookup_replace_object() callsJunio C Hamano, May 15, 2011
  6. 5/5 read_sha1_file(): allow selective bypassing of replacement mechanismJunio C Hamano, May 15, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.