@matheusbsbs / matheus-bagliano / commits / 5166810b1e
Fork 0

rebase -i: create .dotest-merge after validating options.

Creating .dotest-merge before validating the options prevents both --continue and --interactive from working if the options are invalid, so only create it after validating the options. [jc: however, just moving the creation of DOTEST breaks output] Signed-off-by: Matt Kraai <kraai@ftbfs.org> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Matt Kraai committed Sep 25, 2007 at 18:30 UTC 5166810b1e16b22e342f2181a3535e70c6e7a119
1 file changed +4 -4
git-rebase--interactive.sh
+4 -4
@@ -36,10 +36,9 @@ warn () {
36 output () {
37 case "$VERBOSE" in
38 '')
39 - "$@" > "$DOTEST"/output 2>&1
39 + output=$("$@" 2>&1 )
40 status=$?
41 - test $status != 0 &&
42 - cat "$DOTEST"/output
41 + test $status != 0 && printf "%s\n" "$output"
42 return $status
43 ;;
44 *)
@@ -428,7 +427,6 @@ do
427
428 require_clean_work_tree
429
431 - mkdir "$DOTEST" || die "Could not create temporary $DOTEST"
430 if test ! -z "$2"
431 then
432 output git show-ref --verify --quiet "refs/heads/$2" ||
@@ -440,6 +438,8 @@ do
438 HEAD=$(git rev-parse --verify HEAD) || die "No HEAD?"
439 UPSTREAM=$(git rev-parse --verify "$1") || die "Invalid base"
440
441 + mkdir "$DOTEST" || die "Could not create temporary $DOTEST"
442 +
443 test -z "$ONTO" && ONTO=$UPSTREAM
444
445 : > "$DOTEST"/interactive || die "Could not mark as interactive"