git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: [PATCH v2 1/3] add test cases for "git mv -k"
Date: Wed, 14 Jan 2009 18:03:21 +0100	[thread overview]
Message-ID: <1231952603-32527-2-git-send-email-git@drmicha.warpmail.net> (raw)
In-Reply-To: <1231952603-32527-1-git-send-email-git@drmicha.warpmail.net>

Add test cases for ignoring nonexisting and untracked files using the -k
option to "git mv". There is one known breakage related to multiple
untracked files specfied as consecutive arguments.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 t/t7001-mv.sh |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index 575ef5b..5c1485d 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -39,6 +39,31 @@ test_expect_success \
     grep "^R100..*path1/COPYING..*path0/COPYING"'
 
 test_expect_success \
+    'checking -k on non-existing file' \
+    'git mv -k idontexist path0'
+
+test_expect_success \
+    'checking -k on untracked file' \
+    'touch untracked1 &&
+     git mv -k untracked1 path0 &&
+     test -f untracked1 &&
+     test ! -f path0/untracked1'
+
+test_expect_failure \
+    'checking -k on multiple untracked files' \
+    'touch untracked2 &&
+     git mv -k untracked1 untracked2 path0 &&
+     test -f untracked1 &&
+     test -f untracked2 &&
+     test ! -f path0/untracked1
+     test ! -f path0/untracked2'
+
+# clean up the mess in case bad things happen
+rm -f idontexist untracked1 untracked2 \
+     path0/idontexist path0/untracked1 path0/untracked2 \
+     .git/index.lock
+
+test_expect_success \
     'adding another file' \
     'cp "$TEST_DIRECTORY"/../README path0/README &&
      git add path0/README &&
-- 
1.6.0.6

  reply	other threads:[~2009-01-14 17:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-14 13:20 [BUG] assertion failure in builtin-mv.c with "git mv -k" Matthieu Moy
2009-01-14 14:53 ` Michael J Gruber
2009-01-14 15:54   ` Johannes Schindelin
2009-01-14 16:04     ` Michael J Gruber
2009-01-14 16:47       ` Jeff King
2009-01-14 19:02       ` Junio C Hamano
2009-01-15 10:53         ` Michael J Gruber
2009-01-15 22:19           ` Junio C Hamano
2009-01-16 12:57             ` Matthieu Moy
2009-01-14 17:03     ` [PATCH v2 0/3] Add test cases for "git mv -k" and fix a known breakage Michael J Gruber
2009-01-14 17:03       ` Michael J Gruber [this message]
2009-01-14 17:03         ` [PATCH v2 2/3] fix handling of multiple untracked files for git mv -k Michael J Gruber
2009-01-14 17:03           ` [PATCH v2 3/3] mark fixed breakage as expect pass for "git mv -k" multiple files Michael J Gruber
2009-01-14 15:42 ` [PATCH] fix handling of multiple untracked files for git mv -k Michael J Gruber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1231952603-32527-2-git-send-email-git@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).