Hi Alexandr
On 05/11/2019 15:03, Phillip Wood wrote:
[...]
+test_expect_success 'quotes' '
+ restore_checkpoint &&
+
+ git rm fileA.t &&
+ printf "\"file\\101.t\"" | git reset --pathspec-from-file=- &&
+
+ verify_state expect.a
If I've understood correctly this doesn't test if a path is correctly
unquoted, only that it is accepted.
Oh I think I've misunderstood. The '\\' in unquoted by printf, so git
sees '\101' which is A so that is a real file.
Sorry for the confusion
Phillip
+'
+
+test_expect_success 'quotes not compatible with --pathspec-file-null' '
+ restore_checkpoint &&
+
+ git rm fileA.t &&
+ printf "\"file\\101.t\"" >list &&
+ # Note: "git reset" has not yet learned to fail on wrong pathspecs
+ git reset --pathspec-from-file=list --pathspec-file-null &&
+
+ test_must_fail verify_state expect.a
+'
+
+test_expect_success '--pathspec-from-file is not compatible with
--soft --hard' '
s/--soft --hard/--soft or --hard/
+ restore_checkpoint &&
+
+ git rm fileA.t &&
+ echo fileA.t >list &&
+ test_must_fail git reset --soft --pathspec-from-file=list &&
+ test_must_fail git reset --hard --pathspec-from-file=list
+'
+
+test_expect_success 'only touches what was listed' '
s/^/--pathspec-from-file / ?
Best Wishes
Phillip
+ restore_checkpoint &&
+
+ git rm fileA.t fileB.t fileC.t fileD.t &&
+ printf "fileB.t\nfileC.t" | git reset --pathspec-from-file=- &&
+
+ verify_state expect.a_bc_d
+'
+
+test_done