commit 5fb37d40f7ba3b3f71502a7fcd4bd16d4b29ca01
parent bc57e63a273edb3ff829a535e1aeb36cb9e633f6
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 1 May 2024 15:18:26 +0200
Check if wad management is enabled when restoring files
The command failed silently because the sumdge filter was not set. Hence
this commit, which logs an error message and returns an error. Check if
wad management is enabled when checking out
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/git-wad b/git-wad
@@ -363,6 +363,13 @@ fetch() # [-1a]
# Restore the content of WAD files
checkout()
{
+
+ if ! is_init; then
+ >&2 printf "\e[0;31mgit-wad is not initialized\e[0m\n"
+ >&2 printf " (use \"git wad init\" to enable WAD management)\n"
+ return 1
+ fi
+
git ls-files \
| xargs grep -le "^${GIT_WAD_HEADER} [0-9a-z]\{64\} [0-9]\{1,\}$" \
| while read -r i; do