Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add the 'update' subcommand, which updates an existing review branch …

…to the latest patch.
  • Loading branch information...
commit 5b1ba6e9aa7b43298182f824596f001c76545f2b 1 parent 65ce598
Brian Donovan authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 bin/git-review
View
21 bin/git-review
@@ -98,6 +98,9 @@ printUsage() {
echo " Applies the latest patch for the change at <change number> on top of master on a"
echo " branch named for <change number>, allowing you to review the change."
echo
+ echo " update"
+ echo " Updates the review branch that you're currently on to the latest patch."
+ echo
echo " reset"
echo " Removes the current change branch created by the 'start' subcommand and switches"
echo " back to master."
@@ -263,6 +266,20 @@ rebaseReview() {
fi
}
+updateReview() {
+ if ! is_review_branch $CURRENT; then
+ warn "$CURRENT is not a review branch"
+ printUsage
+ exit 2
+ fi
+
+ abort_on_bad_repo_state
+
+ local change=${CURRENT:1}
+ resetReview
+ startReview $change
+}
+
abort_on_bad_repo_state() {
if ! no_changes; then
die "You have local changes. Please do something with them before using $this"
@@ -315,6 +332,10 @@ while true; do
rebaseReview $1
exit
;;
+ update)
+ updateReview
+ exit
+ ;;
*)
if is_integer $arg; then
startReview $arg
Please sign in to comment.
Something went wrong with that request. Please try again.