ae2b0f1518
Now all the users of this script detect its exit status and die, complaining that it is outside git repository. So move the code that dies from all callers to git-sh-setup script. Signed-off-by: Junio C Hamano <junkio@cox.net>
30 lines
573 B
Bash
Executable File
30 lines
573 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Copyright (c) 2005 Junio C Hamano.
|
|
#
|
|
|
|
. git-sh-setup
|
|
|
|
# The other head is given
|
|
other=$(git-rev-parse --verify "$1^0") || exit
|
|
|
|
# The tree must be really really clean.
|
|
git-update-index --refresh || exit
|
|
diff=$(git-diff-index --cached --name-status -r HEAD)
|
|
case "$different" in
|
|
?*) echo "$diff"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# If the branch to rebase is given, first switch to it.
|
|
case "$#" in
|
|
2)
|
|
git-checkout "$2" || exit
|
|
esac
|
|
|
|
# Rewind the head to "$other"
|
|
git-reset --hard "$other"
|
|
git-format-patch -k --stdout --full-index "$other" ORIG_HEAD |
|
|
git am --binary -3 -k
|