fix git diff --stat
previously it would show changes between the current HEAD and the previous HEAD, which would neglect to show all the file changes from multiple commits, only the most recent one. this makes sure we store the HEAD hash from before the system is updated, and then compared to HEAD after it's updated. Co-Authored-By: lloydbayley <21309308+lloydbayley@users.noreply.github.com>
This commit is contained in:
@@ -41,6 +41,9 @@ sudo_with_user () {
|
||||
set +x
|
||||
}
|
||||
|
||||
# Get current HEAD hash
|
||||
commit_hash=$(sudo_with_user git -C $HOME/BirdNET-Pi rev-parse HEAD)
|
||||
|
||||
# Reset current HEAD to remove any local changes
|
||||
sudo_with_user git -C $HOME/BirdNET-Pi reset --hard
|
||||
|
||||
@@ -51,7 +54,7 @@ sudo_with_user git -C $HOME/BirdNET-Pi fetch $remote $branch
|
||||
sudo_with_user git -C $HOME/BirdNET-Pi switch -C $branch --track $remote/$branch
|
||||
|
||||
# Prints out changes
|
||||
sudo_with_user git -C $HOME/BirdNET-Pi diff --stat HEAD^ HEAD
|
||||
sudo_with_user git -C $HOME/BirdNET-Pi diff --stat $commit_hash HEAD
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo ln -sf $my_dir/* /usr/local/bin/
|
||||
|
||||
Reference in New Issue
Block a user