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

[PATCH 1/2] Add test case for mv --dry-run to t7001-mv.sh

From
SMStefan Moch <stefanmoch@mail.de>
Date
Dec 31, 2017, 19:11 UTC
Message-ID
<20171231191156.28359-2-stefanmoch@mail.de>
In-Reply-To
<20171231191156.28359-1-stefanmoch@mail.de>
It checks if mv --dry-run does not move file.
Signed-off-by: Stefan Moch <stefanmoch@mail.de>
---
 t/t7001-mv.sh | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index 6e5031f56..d4e6485a2 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -38,6 +38,12 @@ test_expect_success \
     'git diff-tree -r -M --name-status  HEAD^ HEAD | \
     grep "^R100..*path1/COPYING..*path0/COPYING"'
 
+test_expect_success \
+    'mv --dry-run does not move file' \
+    'git mv -n path0/COPYING MOVED &&
+     test -f path0/COPYING &&
+     test ! -f MOVED'
+
 test_expect_success \
     'checking -k on non-existing file' \
     'git mv -k idontexist path0'
-- 
2.14.3
Previous: Stefan MochNext: Stefan Moch
Message 6 of 12 in “feature-request: git "cp" like there is git mv.”
  1. Simon DoodkinDec 12, 2017
  2. Johannes SchindelinDec 13, 2017
  3. Randall S. BeckerDec 13, 2017
  4. Jonathan NiederDec 16, 2017
  5. Stefan MochDec 31, 2017
  6. 1/2 Add test case for mv --dry-run to t7001-mv.shStefan Moch, Dec 31, 2017
  7. 2/2 mv: remove unneeded 'if (!show_only)'Stefan Moch, Dec 31, 2017
  8. Junio C HamanoFeb 7, 2018
  9. Stefan BellerFeb 7, 2018
  10. Stefan MochMar 18, 2018
  11. Junio C HamanoMar 19, 2018
  12. Igor DjordjevicDec 18, 2017

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.