summaryrefslogtreecommitdiff
path: root/t/t3702-add-edit.sh
AgeCommit message (Collapse)AuthorFilesLines
2021-11-01leak tests: mark some add tests as passing with SANITIZE=leakLibravatar Ævar Arnfjörð Bjarmason1-0/+2
Mark some tests that match "*add*" as passing when git is compiled with SANITIZE=leak. They'll now be listed as running under the "GIT_TEST_PASSING_SANITIZE_LEAK=true" test mode (the "linux-leaks" CI target). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-07t/*: fix ordering of expected/observed argumentsLibravatar Matthew DeVore1-2/+2
Fix various places where the ordering was obviously wrong, meaning it was easy to find with grep. Signed-off-by: Matthew DeVore <matvore@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-05-21t3702: abstract away SHA-1-specific constantsLibravatar brian m. carlson1-4/+3
Strip out the index lines in the diff before comparing them, as these will differ between hash algorithms. This leads to a smaller, simpler change than editing the index line. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-05-12add: check return value of launch_editorLibravatar Jeff King1-0/+7
When running "add -e", if launching the editor fails, we do not notice and continue as if the output is what the user asked for. The likely case is that the editor did not touch the contents at all, and we end up adding everything. Reported-by: Russ Cox <rsc@golang.org> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-27t3702: fix reliance on SHELL_PATH being '/bin/sh'Libravatar Johannes Schindelin1-7/+19
Trying to be lazy and comparing files with fake-editor.sh to avoid having to provide another example text does not work well: the blob name changes when SHELL_PATH changes, and so does the 'index' line in the diff. Therefore provide a second example text. Noticed by Mike Ralphson. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12git-add: introduce --edit (to edit the diff vs. the index)Libravatar Johannes Schindelin1-0/+109
With "git add -e [<files>]", Git will fire up an editor with the current diff relative to the index (i.e. what you would get with "git diff [<files>]"). Now you can edit the patch as much as you like, including adding/removing lines, editing the text, whatever. Make sure, though, that the first character of the hunk lines is still a space, a plus or a minus. After you closed the editor, Git will adjust the line counts of the hunks if necessary, thanks to the --recount option of apply, and commit the patch. Except if you deleted everything, in which case nothing happens (for obvious reasons). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>