diff --git a/bin/checkout-git-folder b/bin/checkout-git-folder index b8685d3..f24b5ba 100755 --- a/bin/checkout-git-folder +++ b/bin/checkout-git-folder @@ -23,16 +23,17 @@ checkout-git-folder() { continue fi - local shallow=$(git config --file .gitmodules --get submodule."$git_folder".shallow) + echo "Stash changes $git_folder" + git -C "$git_folder" stash >/dev/null 2>&1 || true + local shallow=$(git config --file .gitmodules --get submodule."$git_folder".shallow) if [[ "$shallow" = "true" ]]; then - git -C "$git_folder" stash >/dev/null 2>&1 || true + echo "Fetch origin $git_branch:$git_branch for $git_folder" git -C "$git_folder" fetch origin "$git_branch:$git_branch" >/dev/null 2>&1 - git -C "$git_folder" checkout "$commit_ref" >/dev/null 2>&1 - else - git -C "$git_folder" stash >/dev/null 2>&1 || true - git -C "$git_folder" checkout "$commit_ref" >/dev/null 2>&1 fi + + echo "Checkout $commit_ref in $git_folder" + git -C "$git_folder" checkout "$commit_ref" >/dev/null 2>&1 done } cgf() {