Skydio / revup

Effortlessly create and manage pull requests without changing branches. Powers a stacked diffs workflow with python and git "plumbing" commands.
https://github.com/Skydio/revup
MIT License
310 stars 59 forks source link

git: Don't update index if file list is empty #92

Closed jerry-skydio closed 1 year ago

jerry-skydio commented 1 year ago

When making a virtual diff target of an empty old_head, we would first find the diff of the commit. However if this diff is empty, we'd pass an empty string to git update-index which would then hang as it is expecting at least one input.

Solution is to not call update-index at all if there is no diff as it is not necessary. We can just return new_base.

Topic: fix_hang Reviewers: brian-k

jerry-skydio commented 1 year ago

Reviews in this chain: └https://github.com/Skydio/revup/pull/92 git: Don't update index if file list is empty

jerry-skydio commented 1 year ago
# head base diff date summary
0 b500a061 d1433464 diff Mar 6 13:05 PM 1 file changed, 4 insertions(+)
1 f06aa84b fa4e5a9a rebase Mar 6 13:56 PM 0 files changed