Skip to content

Commit 75ced51

Browse files
committed
fix: Add better error when revision resetting fails
1 parent 56c42ba commit 75ced51

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/lib/commands/do-plumbing-clone.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ do-plumbing-clone() {
4141
# If we are going to a specific revision, do it now
4242
if [ -n "$ref" ]; then
4343
local git_output=
44-
if git_output="$(git -C "$BPM_PACKAGES_PATH/$id" reset --hard "$ref")"; then
44+
if git_output="$(git -C "$BPM_PACKAGES_PATH/$id" reset --hard "$ref" 2>&1)"; then
4545
printf "%s\n" " -> Reseting to revision '$ref'"
4646
else
47-
printf "%s\n" "$git_output"
47+
log.error "Could not reset to particular revision '$ref'"
48+
printf " --> %s\n" "Is '$ref' actually in '$id'?"
49+
printf " --> %s\n" "Git output:"
50+
printf " --> %s\n" "${git_output%.}"
51+
exit 1
4852
fi
4953

5054
if [ -n "${BPM_MODE_TEST+x}" ]; then

0 commit comments

Comments
 (0)