You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Don't commit if this would be an empty commit #1056
Currently, after running such code, a commit is created with no changes to the files. I can't find any function that checks for any changes before commit after adding files. I don't mean changes to all code and to all files in the main .git folder, but changes to one file and one folder with many files.
I am also looking for a solution other than using untracked_files in a loop looking to see if my needed files are there.
A commit has a link to a tree, which identifies the state of all files contained with it.
Thus, if the tree hash does not change between commits, they refer to the same state.
I believe one can get a handle on a tree with commit.tree.
Even though I am closing the issue, please feel free to keep posting here for any follow ups.
Activity
Byron commentedon Sep 7, 2020
A commit has a link to a tree, which identifies the state of all files contained with it.
Thus, if the tree hash does not change between commits, they refer to the same state.
I believe one can get a handle on a tree with
commit.tree.Even though I am closing the issue, please feel free to keep posting here for any follow ups.
mhajder commentedon Sep 7, 2020
Thanks for the answer. I was able to find such a solution. I don't know if it's completely correct but it's important that it works.