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

[PATCH/BUG] Test for git-add -u from the subdirectory

From
SZSalikh Zakirov <salikh.zakirov@gmail.com>
Date
Aug 13, 2007, 10:54 UTC
Message-ID
<20070813105415.GC14775@makoto.sib>
---

The following modification to the t2200-add-update.sh shows that the git-add -u from the subdirectory does not work with path limiters.

The test modification alone fails on master. I've tried the revision 93c44d49 'git-add: allow path limiting with -u', which introduced 'git-add -u', and it fails the test as well.

So technically, this feature never worked. I use it as

    [alias]
	ci = add -u
	# used to be
	#ci = update-index
	# and worked
and the simplest workaround is to use git-add instead of git-ci.
 t/t2200-add-update.sh |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index 0a703af..93c007d 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -35,4 +35,12 @@ test_expect_success 'update did not touch other tracked files' \
 test_expect_success 'update did not touch untracked files' \
   'test "`git diff-files --name-status dir/other`" = ""'
 
+test_expect_success 'more changes' 'echo modified >> dir/sub'
+
+test_expect_success 'update from subdirectory' \
+  '(cd dir; git add -u sub)'
+
+test_expect_success 'update touched correct path' \
+  'test "`git diff-files --name-status dir/sub`" = ""'
+
 test_done
-- 
1.5.2.rc3.5.g93c44
Message 1 of 1 in “Test for git-add -u from the subdirectory”
  1. Test for git-add -u from the subdirectorySalikh Zakirov, Aug 13, 2007

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.