From 4aeeac14bac0d75fc6603744bdf706ff69d70762 Mon Sep 17 00:00:00 2001 From: Owen W. Taylor Date: Apr 07 2021 21:02:42 +0000 Subject: rebase.sh: use 'git add' before 'git diff-index' git diff-index only tells "potentially changed" - not "actually changed". Calling git add before git diff-index makes git update the index sufficiently to tell "actually changed". --- diff --git a/tools/rebase.sh b/tools/rebase.sh index 703e7c4..b4cf4ba 100755 --- a/tools/rebase.sh +++ b/tools/rebase.sh @@ -82,10 +82,10 @@ git checkout -q --detach "$target" git checkout -f -- . "$update_py" -q --input-dir="$tmpdir/target" --output-dir="$tmpdir/target" +git add "${SPECIAL_FILES[@]}" if git diff-index --quiet "$target" -- ; then echo "nothing to do" else - git add "${SPECIAL_FILES[@]}" git commit -q -m "Update to latest Flathub data" echo "done" fi @@ -102,8 +102,8 @@ for file in "${SPECIAL_FILES[@]}" ; do cp "$tmpdir/target/$file" "$tmpdir/work" done +git add "${SPECIAL_FILES[@]}" if ! git diff-index --quiet "$merge_base" -- ; then - git add "${SPECIAL_FILES[@]}" git commit -q -m "Update to latest Flathub data" fi