summaryrefslogtreecommitdiff
path: root/t/lib-rebase.sh
diff options
context:
space:
mode:
authorGalan Rémi <remi.galan-alfonso@ensimag.grenoble-inp.fr>2015-06-29 20:20:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-30 19:14:25 (GMT)
commit804098bb30a5339cccb0be981a3e876245aa0ae5 (patch)
treef8d9133bc7c589fd94d0c504a825567fd25b61e9 /t/lib-rebase.sh
parent370799596081e1d1f862e42305ba8119183bde94 (diff)
downloadgit-804098bb30a5339cccb0be981a3e876245aa0ae5.zip
git-804098bb30a5339cccb0be981a3e876245aa0ae5.tar.gz
git-804098bb30a5339cccb0be981a3e876245aa0ae5.tar.bz2
git rebase -i: add static check for commands and SHA-1
Check before the start of the rebasing if the commands exists, and for the commands expecting a SHA-1, check if the SHA-1 is present and corresponds to a commit. In case of error, print the error, stop git rebase and prompt the user to fix with 'git rebase --edit-todo' or to abort. This allows to avoid doing half of a rebase before finding an error and giving back what's left of the todo list to the user and prompt him to fix when it might be too late for him to do so (he might have to abort and restart the rebase). Signed-off-by: Galan Rémi <remi.galan-alfonso@ensimag.grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-rebase.sh')
-rw-r--r--t/lib-rebase.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh
index fdbc900..9a96e15 100644
--- a/t/lib-rebase.sh
+++ b/t/lib-rebase.sh
@@ -54,6 +54,11 @@ set_fake_editor () {
echo '# comment' >> "$1";;
">")
echo >> "$1";;
+ bad)
+ action="badcmd";;
+ fakesha)
+ echo "$action XXXXXXX False commit" >> "$1"
+ action=pick;;
*)
sed -n "${line}s/^pick/$action/p" < "$1".tmp >> "$1"
action=pick;;