diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-04-25 04:28:53 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-25 04:28:53 (GMT) |
commit | 8295f2028f622da2da2b9e31a2793be64ce45a07 (patch) | |
tree | 77e4db49ee740231a2a8cb863b7f20368af93e88 /t | |
parent | ff6eb825f0aa1f45230c10fbb0cf8d484c927c55 (diff) | |
parent | 86238e07ef633f7488ac708578aaf71e4375c057 (diff) | |
download | git-8295f2028f622da2da2b9e31a2793be64ce45a07.zip git-8295f2028f622da2da2b9e31a2793be64ce45a07.tar.gz git-8295f2028f622da2da2b9e31a2793be64ce45a07.tar.bz2 |
Merge branch 'bw/commit-partial-from-subdirectory-fix'
"cd sub/dir && git commit ../path" ought to record the changes to
the file "sub/path", but this regressed long time ago.
* bw/commit-partial-from-subdirectory-fix:
commit: allow partial commits with relative paths
Diffstat (limited to 't')
-rwxr-xr-x | t/t7501-commit.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index fa61b1a..9dbbd01 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -52,6 +52,18 @@ test_expect_success PERL 'can use paths with --interactive' ' git reset --hard HEAD^ ' +test_expect_success 'removed files and relative paths' ' + test_when_finished "rm -rf foo" && + git init foo && + >foo/foo.txt && + git -C foo add foo.txt && + git -C foo commit -m first && + git -C foo rm foo.txt && + + mkdir -p foo/bar && + git -C foo/bar commit -m second ../foo.txt +' + test_expect_success 'using invalid commit with -C' ' test_must_fail git commit --allow-empty -C bogus ' |