t7001: use "ls-files --format" instead of "cut"
Since ls-files recently learned a "--format" option, we can use that rather than asking for all of "--stage" and then pulling out the bits we want with "cut". That's simpler and avoids two extra processes (one for cut, and one for the subshell to hold the intermediate result). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
b1c8ac3996
commit
a9ea5296b7
|
|
@ -5,8 +5,7 @@ test_description='git mv in subdirs'
|
||||||
. "$TEST_DIRECTORY"/lib-diff-data.sh
|
. "$TEST_DIRECTORY"/lib-diff-data.sh
|
||||||
|
|
||||||
index_at_path () {
|
index_at_path () {
|
||||||
entry=$(git ls-files --stage "$@") &&
|
git ls-files --format='%(objectmode) %(objectname) %(stage)' "$@"
|
||||||
echo "$entry" | cut -f 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test_expect_success 'mv -f refreshes updated index entry' '
|
test_expect_success 'mv -f refreshes updated index entry' '
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue