hub icon indicating copy to clipboard operation
hub copied to clipboard

hub sync crashes if branch disappears during iteration

Open ilovezfs opened this issue 8 years ago • 2 comments

Running hub sync, I see

warning: `gssdp-0.14.15' seems to contain unpushed commits

Once hub sync completes, I kick it off again. Before it gets to gssdp-0.14.15, while it's listing other branches with unpushed commits, in another shell I delete gssdp-0.14.15:

$ git branch -D gssdp-0.14.15
Deleted branch gssdp-0.14.15 (was 265d3fc8da).

At that point, when hub sync reaches gssdp-0.14.5 in its iteration, it crashes:

...
warning: `googler-2.5.1' seems to contain unpushed commits
warning: `gosu-1.13.5' seems to contain unpushed commits
warning: `gpac-0.6.1' seems to contain unpushed commits
warning: `gputils-1.4.2-1' seems to contain unpushed commits
exit status 128

So it may benefit from sort of locking or at least shouldn't assume the branch will still exist when it gets to it.

ilovezfs avatar Jan 02 '17 08:01 ilovezfs

Interesting; thanks for reporting this. Yes, I think hub should just ignore a branch that was removed since the sync operation was started.

mislav avatar Jan 04 '17 14:01 mislav

+1 on this

marandaneto avatar Apr 08 '24 07:04 marandaneto