#!/bin/sh . git-sh-setup-script || die "Not a git archive" if [ -n "$(git-diff-files)" ]; then echo The following files should be updated! echo git-diff-files | awk '{print $6}' fi undostack=$GIT_DIR/undostack if [ ! -s $undostack ]; then echo "No undo information in $undostack" else # Read the top of the stack basetree=$(cat $undostack | tail -n 2 | head -n 1) redotree=$(cat $undostack | tail -n 1) # Pop the stack cat $undostack | head -n -2 > $undostack.tmp mv $undostack{.tmp,} currenttree=$(git-write-tree) git-read-tree -u -m $basetree $currenttree $redotree git-merge-cache git-merge-one-file-script -a fi