diff options
-rwxr-xr-x | git-resolve-script | 10 | ||||
-rwxr-xr-x | git-status-script | 6 | ||||
-rw-r--r-- | templates/hooks--update | 8 |
3 files changed, 15 insertions, 9 deletions
diff --git a/git-resolve-script b/git-resolve-script index 7c0e3d8aa8..000cbb85e3 100755 --- a/git-resolve-script +++ b/git-resolve-script @@ -36,19 +36,21 @@ if [ -z "$common" ]; then die "Unable to find common commit between" $merge $head fi -if [ "$common" == "$merge" ]; then +case "$common" in +"$merge") echo "Already up-to-date. Yeeah!" dropheads exit 0 -fi -if [ "$common" == "$head" ]; then + ;; +"$head") echo "Updating from $head to $merge." git-read-tree -u -m $head $merge || exit 1 echo $merge > "$GIT_DIR"/HEAD git-diff-tree -p $head $merge | git-apply --stat dropheads exit 0 -fi + ;; +esac # Find an optimum merge base if there are more than one candidates. LF=' diff --git a/git-status-script b/git-status-script index 2b029545de..ee8f7061ea 100755 --- a/git-status-script +++ b/git-status-script @@ -77,9 +77,9 @@ then #' fi -if [ "$committable" == "0" ] -then +case "$committable" in +0) echo "nothing to commit" exit 1 -fi +esac exit 0 diff --git a/templates/hooks--update b/templates/hooks--update index 0726975367..3f38b82a47 100644 --- a/templates/hooks--update +++ b/templates/hooks--update @@ -16,10 +16,14 @@ then git-rev-list --pretty "$3" else $base=$(git-merge-base "$2" "$3") - if [ $base == "$2" ]; then + case "$base" in + "$2") echo "New commits:" - else + ;; + *) echo "Rebased ref, commits from common ancestor:" + ;; + esac fi git-rev-list --pretty "$3" "^$base" fi | |