summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-28 21:52:28 -0700
committerJunio C Hamano <gitster@pobox.com>2010-03-28 21:52:28 -0700
commit99f5b0845ac53f9f6e845fe4401e68fcef154690 (patch)
tree5647dacc82fa90cb8de24ec4f4b9abea249707cf /git-rebase--interactive.sh
parent3b37d9c17efd199a237435f7d8573008f6aa68c1 (diff)
parent28db756feead84929cdfaaee8bccd301384daab4 (diff)
downloadgit-99f5b0845ac53f9f6e845fe4401e68fcef154690.tar.gz
Merge branch 'cc/cherry-pick-ff'
* cc/cherry-pick-ff: revert: fix tiny memory leak in cherry-pick --ff rebase -i: use new --ff cherry-pick option Documentation: describe new cherry-pick --ff option cherry-pick: add tests for new --ff option revert: add --ff option to allow fast forward when cherry-picking builtin/merge: make checkout_fast_forward() non static parse-options: add parse_options_concat() to concat options
Diffstat (limited to 'git-rebase--interactive.sh')
-rwxr-xr-xgit-rebase--interactive.sh15
1 files changed, 3 insertions, 12 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 8a2771f1f9..1d116bfae2 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -230,8 +230,8 @@ do_with_author () {
}
pick_one () {
- no_ff=
- case "$1" in -n) sha1=$2; no_ff=t ;; *) sha1=$1 ;; esac
+ ff=--ff
+ case "$1" in -n) sha1=$2; ff= ;; *) sha1=$1 ;; esac
output git rev-parse --verify $sha1 || die "Invalid commit name: $sha1"
test -d "$REWRITTEN" &&
pick_one_preserving_merges "$@" && return
@@ -240,16 +240,7 @@ pick_one () {
output git cherry-pick "$@"
return
fi
- parent_sha1=$(git rev-parse --verify $sha1^) ||
- die "Could not get the parent of $sha1"
- current_sha1=$(git rev-parse --verify HEAD)
- if test -z "$no_ff" && test "$current_sha1" = "$parent_sha1"
- then
- output git reset --hard $sha1
- output warn Fast-forward to $(git rev-parse --short $sha1)
- else
- output git cherry-pick "$@"
- fi
+ output git cherry-pick $ff "$@"
}
pick_one_preserving_merges () {