Skip to content

Commit e1a3493

Browse files
committed
Stop parameter for multi-commit mode when the base branch was already updated
1 parent ebe1af3 commit e1a3493

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

bin/git-update-parent-branch

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
CURRENT_BRANCH="$(git current-branch)"
44
PARENT_BRANCH=""
55
COMMIT_MODE="multi-commit"
6+
UNTIL_COMMIT=""
67
COMMITS=""
78

89
while getopts ":-:" opt; do
@@ -30,6 +31,10 @@ else
3031
COMMON_ANCESTOR="$(git merge-base "$CURRENT_BRANCH" "$PARENT_BRANCH")"
3132
COMMITS="$(git rev-list "$CURRENT_BRANCH"..."$COMMON_ANCESTOR")"
3233
fi
34+
35+
if [ "$2" != "" ]; then
36+
UNTIL_COMMIT="$2"
37+
fi
3338
fi
3439
# TODO - What if we don't have commits?
3540

@@ -55,6 +60,9 @@ else
5560
COMMIT_ARRAY=($COMMIT_LIST)
5661
for commit_id in "${COMMIT_ARRAY[@]}"
5762
do
63+
if [ "$UNTIL_COMMIT" == "$commit_id" ]; then
64+
break
65+
fi
5866
echo "----"
5967
echo "Cherry Picking -> $commit_id"
6068
git cherry-pick "$commit_id"

0 commit comments

Comments
 (0)