mirror of
https://github.com/git/git
synced 2024-10-30 04:01:21 +00:00
93c44d493b
Rather than updating all working tree paths, we limit ourselves to paths listed on the command line. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
38 lines
946 B
Bash
Executable file
38 lines
946 B
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='git-add -u with path limiting
|
|
|
|
This test creates a working tree state with three files:
|
|
|
|
top (previously committed, modified)
|
|
dir/sub (previously committed, modified)
|
|
dir/other (untracked)
|
|
|
|
and issues a git-add -u with path limiting on "dir" to add
|
|
only the updates to dir/sub.'
|
|
|
|
. ./test-lib.sh
|
|
|
|
test_expect_success 'setup' '
|
|
echo initial >top &&
|
|
mkdir dir &&
|
|
echo initial >dir/sub &&
|
|
git-add dir/sub top &&
|
|
git-commit -m initial &&
|
|
echo changed >top &&
|
|
echo changed >dir/sub &&
|
|
echo other >dir/other
|
|
'
|
|
|
|
test_expect_success 'update' 'git-add -u dir'
|
|
|
|
test_expect_success 'update touched correct path' \
|
|
'test "`git-diff-files --name-status dir/sub`" = ""'
|
|
|
|
test_expect_success 'update did not touch other tracked files' \
|
|
'test "`git-diff-files --name-status top`" = "M top"'
|
|
|
|
test_expect_success 'update did not touch untracked files' \
|
|
'test "`git-diff-files --name-status dir/other`" = ""'
|
|
|
|
test_done
|