git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v2 1/3] Add tests for describe with --work-tree
@ 2019-01-26 20:49 Sebastian Staudt
  2019-01-26 20:49 ` [PATCH v2 2/3] Setup working tree in describe Sebastian Staudt
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Sebastian Staudt @ 2019-01-26 20:49 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano, Jeff King, Duy Nguyen, Sebastian Staudt

The dirty ones are already passing, but just because describe is comparing
with the wrong working tree.

Signed-off-by: Sebastian Staudt <koraktor@gmail.com>
---
 t/t6120-describe.sh | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index d639d94696..9a6bd1541f 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -28,6 +28,24 @@ check_describe () {
 	'
 }
 
+check_describe_worktree () {
+  cd "$TEST_DIRECTORY"
+	expect="$1"
+	shift
+	R=$(git --git-dir "$TRASH_DIRECTORY/.git" --work-tree "$TRASH_DIRECTORY" describe "$@" 2>err.actual)
+	S=$?
+	cat err.actual >&3
+	test_expect_success "describe with --work-tree $*" '
+	test $S = 0 &&
+	case "$R" in
+	$expect)	echo happy ;;
+	*)	echo "Oops - $R is not $expect";
+		false ;;
+	esac
+	'
+  cd "$TRASH_DIRECTORY"
+}
+
 test_expect_success setup '
 
 	test_tick &&
@@ -145,14 +163,20 @@ check_describe A-* HEAD
 
 check_describe "A-*[0-9a-f]" --dirty
 
+check_describe_worktree "A-*[0-9a-f]" --dirty
+
 test_expect_success 'set-up dirty work tree' '
 	echo >>file
 '
 
 check_describe "A-*[0-9a-f]-dirty" --dirty
 
+check_describe_worktree "A-*[0-9a-f]-dirty" --dirty
+
 check_describe "A-*[0-9a-f].mod" --dirty=.mod
 
+check_describe_worktree "A-*[0-9a-f].mod" --dirty=.mod
+
 test_expect_success 'describe --dirty HEAD' '
 	test_must_fail git describe --dirty HEAD
 '
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-01-30 16:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-26 20:49 [PATCH v2 1/3] Add tests for describe with --work-tree Sebastian Staudt
2019-01-26 20:49 ` [PATCH v2 2/3] Setup working tree in describe Sebastian Staudt
2019-01-27  0:21   ` Duy Nguyen
2019-01-27  7:19     ` Sebastian Staudt
2019-01-26 20:49 ` [PATCH v2 3/3] Add test for describe with a bare repository Sebastian Staudt
2019-01-27  0:25   ` Duy Nguyen
2019-01-27  6:54     ` Sebastian Staudt
2019-01-27  0:07 ` [PATCH v2 1/3] Add tests for describe with --work-tree Duy Nguyen
2019-01-27  7:13   ` Sebastian Staudt
2019-01-28 10:06     ` Duy Nguyen
2019-01-30 16:47       ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).