echo "unknown flag $arg"
exit 1
fi
- new="$rev"
new_name="$arg"
if git-show-ref --verify --quiet -- "refs/heads/$arg"
then
+ rev=$(git-rev-parse --verify "refs/heads/$arg^0")
branch="$arg"
fi
+ new="$rev"
elif rev=$(git-rev-parse --verify "$arg^{tree}" 2>/dev/null)
then
# checking out selected paths from a tree-ish.
esac
# Match the index to the working tree, and do a three-way.
- git diff-files --name-only | git update-index --remove --stdin &&
+ git diff-files --name-only | git update-index --remove --stdin &&
work=`git write-tree` &&
git read-tree $v --reset -u $new || exit
(exit $saved_err)
fi
-#
+#
# Switch the HEAD pointer to the new branch if we
# checked out a branch head, and remove any potential
# old MERGE_HEAD's (subsequent commits will clearly not