From 9bb89067f2a664eb9e71a543d4566fb2e8ef85ae Mon Sep 17 00:00:00 2001 From: Rory Coughlan <35547211+Gumbo64@users.noreply.github.com> Date: Tue, 10 Sep 2024 23:59:36 +1000 Subject: [PATCH] Make patches work when using git submodules (#285) --- tools/create_patch.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/create_patch.sh b/tools/create_patch.sh index ea75d9cca..0fd35a2d3 100755 --- a/tools/create_patch.sh +++ b/tools/create_patch.sh @@ -10,15 +10,9 @@ then exit 1 fi -# Make sure this is a git repository -if [ ! -d .git ] -then - echo 'Error: The current directory is not a Git repository.' - exit 1 -fi - # 'git diff' is stupid and doesn't show new untracked files, so we must add them first. -git add . +# Also make sure this is a valid git repository, throw an error otherwise ( || exit 1 ) +git add . || exit 1 # Generate the patch. git diff -p --staged > "$1" # Undo the 'git add'.