From c8bae7493d2f2910b57f13ded012e86bdcfb0532 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:47:53 +0200 Subject: Adding upstream version 1:2.39.2. Signed-off-by: Daniel Baumann --- t/t3020-ls-files-error-unmatch.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 t/t3020-ls-files-error-unmatch.sh (limited to 't/t3020-ls-files-error-unmatch.sh') diff --git a/t/t3020-ls-files-error-unmatch.sh b/t/t3020-ls-files-error-unmatch.sh new file mode 100755 index 0000000..133593d --- /dev/null +++ b/t/t3020-ls-files-error-unmatch.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Copyright (c) 2006 Carl D. Worth +# + +test_description='git ls-files test for --error-unmatch option + +This test runs git ls-files --error-unmatch to ensure it correctly +returns an error when a non-existent path is provided on the command +line. +' + +TEST_PASSES_SANITIZE_LEAK=true +. ./test-lib.sh + +test_expect_success 'setup' ' + touch foo bar && + git update-index --add foo bar && + git commit -m "add foo bar" +' + +test_expect_success 'git ls-files --error-unmatch should fail with unmatched path.' ' + test_must_fail git ls-files --error-unmatch foo bar-does-not-match +' + +test_expect_success 'git ls-files --error-unmatch should succeed with matched paths.' ' + git ls-files --error-unmatch foo bar +' + +test_done -- cgit v1.2.3