# If there is no registered remote, then $orig_remote is the URL
orig_remote_url="$orig_remote"
fi
+orig_head=$(git rev-parse --abbrev-ref '@{u}' 2>/dev/null || git rev-parse HEAD)
# Make sure it's a branch we recognise
if (echo "$orig_branch" \
# We always expect to start from a state of development
if [ "$TYPE" != 'dev' ]; then
- upstream=$(git rev-parse --abbrev-ref '@{u}' 2>/dev/null || echo 'HEAD^')
if $clean_worktree; then
cat >&2 <<EOF
Not in a development branch.
Have a look at the git log, it may be that a previous crash left it in
an intermediate state and that need to drop the top commit:
-git reset --hard $upstream
+git reset --hard $orig_head
# WARNING! LOOK BEFORE YOU ACT, KNOW WHAT YOU DO
EOF
else
if [ -n "$release_clone" ]; then
echo "clone_directory='$release_clone'"
fi
+ echo "orig_head='$orig_head'"
echo "metadata='$metadata'"
else
cat <<EOF