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

[PATCH next] test-lib: set $DIFF to diff if it is unset

From
Thomas Rast <trast@student.ethz.ch>
Date
Jun 10, 2010, 09:39 UTC
Message-ID
<06ffbe0ca6aac061336f6f595e89f75c09ab88ac.1276162629.git.trast@student.ethz.ch>

Since 7b3bdbb (fixup: do not unconditionally disable "diff -u", 2010-05-31), test-lib.sh depends on having $DIFF set in the environment for the construction of $GIT_TEST_CMP. While this works when called from the main Makefile, it fails if the tests are called on their own and the user does not have $DIFF set.

Set it to 'diff' if it is unset, like the Makefile does.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---

I have an uneasy feeling that I must be missing something, seeing as this went unnoticed for 10 days...

 t/test-lib.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index b23a61d..4d89049 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -78,6 +78,7 @@ export EDITOR
 
 if test -z "$GIT_TEST_CMP"
 then
+	DIFF=${DIFF:-diff}
 	if test -n "$GIT_TEST_CMP_USE_COPIED_CONTEXT"
 	then
 		GIT_TEST_CMP="$DIFF -c"
-- 
1.7.1.550.g553ab5
Next: Ævar Arnfjörð Bjarmason
Message 1 of 7 in “test-lib: set $DIFF to diff if it is unset”
  1. test-lib: set $DIFF to diff if it is unsetThomas Rast, Jun 10, 2010
  2. Ævar Arnfjörð BjarmasonJun 10, 2010
  3. Brandon CaseyJun 10, 2010
  4. Junio C HamanoJun 11, 2010
  5. Brandon CaseyJun 11, 2010
  6. Brandon CaseyJun 15, 2010
  7. Thomas RastJun 11, 2010

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.