rebase: use peel_committish() where appropriate
The revisions specified on the command-line as <onto> and <upstream> arguments could be of the form :/quuxery; so, use peel_committish() to resolve them. The failing tests in t/rebase and t/rebase-interactive now pass. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
							parent
							
								
									bac1ddd0f8
								
							
						
					
					
						commit
						2e6e276dec
					
				|  | @ -434,7 +434,7 @@ then | ||||||
| 		shift | 		shift | ||||||
| 		;; | 		;; | ||||||
| 	esac | 	esac | ||||||
| 	upstream=`git rev-parse --verify "${upstream_name}^0"` || | 	upstream=$(peel_committish "${upstream_name}") || | ||||||
| 	die "$(eval_gettext "invalid upstream \$upstream_name")" | 	die "$(eval_gettext "invalid upstream \$upstream_name")" | ||||||
| 	upstream_arg="$upstream_name" | 	upstream_arg="$upstream_name" | ||||||
| else | else | ||||||
|  | @ -470,7 +470,7 @@ case "$onto_name" in | ||||||
| 	fi | 	fi | ||||||
| 	;; | 	;; | ||||||
| *) | *) | ||||||
| 	onto=$(git rev-parse --verify "${onto_name}^0") || | 	onto=$(peel_committish "$onto_name") || | ||||||
| 	die "$(eval_gettext "Does not point to a valid commit: \$onto_name")" | 	die "$(eval_gettext "Does not point to a valid commit: \$onto_name")" | ||||||
| 	;; | 	;; | ||||||
| esac | esac | ||||||
|  |  | ||||||
|  | @ -88,7 +88,7 @@ test_expect_success 'rebase fast-forward to master' ' | ||||||
| 	test_i18ngrep "Fast-forwarded HEAD to my-topic-branch" out | 	test_i18ngrep "Fast-forwarded HEAD to my-topic-branch" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_failure 'rebase, with <onto> and <upstream> specified as :/quuxery' ' | test_expect_success 'rebase, with <onto> and <upstream> specified as :/quuxery' ' | ||||||
| 	test_when_finished "git branch -D torebase" && | 	test_when_finished "git branch -D torebase" && | ||||||
| 	git checkout -b torebase my-topic-branch^ && | 	git checkout -b torebase my-topic-branch^ && | ||||||
| 	upstream=$(git rev-parse ":/Add B") && | 	upstream=$(git rev-parse ":/Add B") && | ||||||
|  |  | ||||||
|  | @ -947,7 +947,7 @@ test_expect_success 'rebase -i respects core.commentchar' ' | ||||||
| 	test B = $(git cat-file commit HEAD^ | sed -ne \$p) | 	test B = $(git cat-file commit HEAD^ | sed -ne \$p) | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_failure 'rebase -i, with <onto> and <upstream> specified as :/quuxery' ' | test_expect_success 'rebase -i, with <onto> and <upstream> specified as :/quuxery' ' | ||||||
| 	test_when_finished "git branch -D torebase" && | 	test_when_finished "git branch -D torebase" && | ||||||
| 	git checkout -b torebase branch1 && | 	git checkout -b torebase branch1 && | ||||||
| 	upstream=$(git rev-parse ":/J") && | 	upstream=$(git rev-parse ":/J") && | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Ramkumar Ramachandra
						Ramkumar Ramachandra