Commits

Anonymous committed 06de561 Merge

Merge branch 'ef/maint-rebase-error-message' into maint

When "git rebase" was given a bad commit to replay the history on,
its error message did not correctly give the command line argument
it had trouble parsing.

By Erik Faye-Lund
* ef/maint-rebase-error-message:
rebase: report invalid commit correctly

Comments (0)

Files changed (2)

 	;;
 *)
 	onto=$(git rev-parse --verify "${onto_name}^0") ||
-	die "Does not point to a valid commit: $1"
+	die "Does not point to a valid commit: $onto_name"
 	;;
 esac
 

t/t3406-rebase-message.sh

         ! grep "^ fileX |  *1 +$" diffstat.txt
 '
 
+test_expect_success 'rebase --onto outputs the invalid ref' '
+	test_must_fail git rebase --onto invalid-ref HEAD HEAD 2>err &&
+	grep "invalid-ref" err
+'
+
 test_done
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.