forked from msysgit/git
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'phase-out-reset-stdin'
This topic branch re-adds the deprecated --stdin/-z options to `git reset`. Those patches were overridden by a different set of options in the upstream Git project before we could propose `--stdin`. We offered this in MinGit to applications that wanted a safer way to pass lots of pathspecs to Git, and these applications will need to be adjusted. Instead of `--stdin`, `--pathspec-from-file=-` should be used, and instead of `-z`, `--pathspec-file-nul`. Signed-off-by: Johannes Schindelin <[email protected]>
- Loading branch information
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
test_description='reset --stdin' | ||
|
||
. ./test-lib.sh | ||
|
||
test_expect_success 'reset --stdin' ' | ||
test_commit hello && | ||
git rm hello.t && | ||
test -z "$(git ls-files hello.t)" && | ||
echo hello.t | git reset --stdin && | ||
test hello.t = "$(git ls-files hello.t)" | ||
' | ||
|
||
test_expect_success 'reset --stdin -z' ' | ||
test_commit world && | ||
git rm hello.t world.t && | ||
test -z "$(git ls-files hello.t world.t)" && | ||
printf world.tQworld.tQhello.tQ | q_to_nul | git reset --stdin -z && | ||
printf "hello.t\nworld.t\n" >expect && | ||
git ls-files >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success '--stdin requires --mixed' ' | ||
echo hello.t >list && | ||
test_must_fail git reset --soft --stdin <list && | ||
test_must_fail git reset --hard --stdin <list && | ||
git reset --mixed --stdin <list | ||
' | ||
|
||
test_done |