[PATCH 1/4] Add testcases showing how pathspecs are ignored with rev-list --objects

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?=
Date: Sunday, September 5, 2010 - 9:47 pm

From: Elijah Newren <newren@gmail.com>

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 No changes.

 t/t6000-rev-list-misc.sh |   51 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)
 create mode 100755 t/t6000-rev-list-misc.sh

diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
new file mode 100755
index 0000000..b3c1dd8
--- /dev/null
+++ b/t/t6000-rev-list-misc.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+test_description='miscellaneous rev-list tests'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+	echo content1 >wanted_file &&
+	echo content2 >unwanted_file &&
+	git add wanted_file unwanted_file &&
+	git commit -m one
+'
+
+test_expect_failure 'rev-list --objects heeds pathspecs' '
+	git rev-list --objects HEAD -- wanted_file >output &&
+	grep wanted_file output &&
+	! grep unwanted_file output
+'
+
+test_expect_failure 'rev-list --objects with pathspecs and deeper paths' '
+	mkdir foo &&
+	>foo/file &&
+	git add foo/file &&
+	git commit -m two &&
+
+	git rev-list --objects HEAD -- foo >output &&
+	grep foo/file output &&
+
+	git rev-list --objects HEAD -- foo/file >output &&
+	grep foo/file output &&
+	! grep unwanted_file output
+'
+
+test_expect_failure 'rev-list --objects with pathspecs and copied files' '
+	git checkout --orphan junio-testcase &&
+	git rm -rf . &&
+
+	mkdir two &&
+	echo frotz >one &&
+	cp one two/three &&
+	git add one two/three &&
+	test_tick &&
+	git commit -m that &&
+
+	ONE=$(git rev-parse HEAD:one)
+	git rev-list --objects HEAD two >output &&
+	grep "$ONE two/three" output &&
+	! grep one output
+'
+
+test_done
-- 
1.7.1.rc1.69.g24c2f7

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC PATCH 00/15] Sparse clones, Elijah Newren, (Sat Sep 4, 5:13 pm)
[RFC PATCH 14/15] EVIL COMMIT: Include all commits, Elijah Newren, (Sat Sep 4, 5:14 pm)
Re: [RFC PATCH 06/15] Automatically reuse sparse limiting ..., Nguyen Thai Ngoc Duy, (Sat Sep 4, 6:58 pm)
Re: [RFC PATCH 05/15] read_tree_recursive: Avoid missing b ..., Nguyen Thai Ngoc Duy, (Sat Sep 4, 7:00 pm)
Re: [RFC PATCH 01/15] README-sparse-clone: Add a basic wri ..., Nguyen Thai Ngoc Duy, (Sat Sep 4, 8:01 pm)
Re: [RFC PATCH 06/15] Automatically reuse sparse limiting ..., Nguyen Thai Ngoc Duy, (Sun Sep 5, 12:12 am)
Re: [RFC PATCH 07/15] cache_tree_update(): Capability to h ..., Nguyen Thai Ngoc Duy, (Sun Sep 5, 12:54 am)
Re: [RFC PATCH 01/15] README-sparse-clone: Add a basic wri ..., Nguyen Thai Ngoc Duy, (Sun Sep 5, 8:14 pm)
[PATCH 0/4] en/object-list-with-pathspec update, =?UTF-8?q?Nguy=E1=BB ..., (Sun Sep 5, 9:47 pm)
[PATCH 1/4] Add testcases showing how pathspecs are ignore ..., =?UTF-8?q?Nguy=E1=BB ..., (Sun Sep 5, 9:47 pm)
[PATCH 2/4] tree-walk: copy tree_entry_interesting() as is ..., =?UTF-8?q?Nguy=E1=BB ..., (Sun Sep 5, 9:47 pm)
[PATCH 3/4] tree-walk: actually move tree_entry_interestin ..., =?UTF-8?q?Nguy=E1=BB ..., (Sun Sep 5, 9:47 pm)
[PATCH 4/4] Make rev-list --objects work together with pat ..., =?UTF-8?q?Nguy=E1=BB ..., (Sun Sep 5, 9:47 pm)
Re: [RFC PATCH 07/15] cache_tree_update(): Capability to h ..., Nguyen Thai Ngoc Duy, (Sun Sep 5, 10:02 pm)
Re: [PATCH 2/4] tree-walk: copy tree_entry_interesting() a ..., Nguyen Thai Ngoc Duy, (Mon Sep 6, 3:09 pm)
Re: [PATCH 3/4] tree-walk: actually move tree_entry_intere ..., Nguyen Thai Ngoc Duy, (Mon Sep 6, 3:20 pm)
Re: [RFC PATCH 07/15] cache_tree_update(): Capability to h ..., Nguyen Thai Ngoc Duy, (Mon Sep 6, 6:28 pm)