equal
deleted
inserted
replaced
639 |
639 |
640 retdata = p.stdout.read().strip() |
640 retdata = p.stdout.read().strip() |
641 # wait for the child to exit to avoid race condition. |
641 # wait for the child to exit to avoid race condition. |
642 p.wait() |
642 p.wait() |
643 |
643 |
644 if p.returncode != 0: |
644 if p.returncode != 0 and p.returncode != 1: |
645 # there are certain error codes that are ok |
645 # there are certain error codes that are ok |
646 command = None |
646 command = None |
647 for arg in commands: |
647 for arg in commands: |
648 if not arg.startswith('-'): |
648 if not arg.startswith('-'): |
649 command = arg |
649 command = arg |
650 break |
650 break |
651 if command == 'cat-file': |
651 if command == 'cat-file': |
652 return retdata, p.returncode |
|
653 if command in ('commit', 'status') and p.returncode == 1: |
|
654 return retdata, p.returncode |
652 return retdata, p.returncode |
655 # for all others, abort |
653 # for all others, abort |
656 raise util.Abort('git %s error %d' % (command, p.returncode)) |
654 raise util.Abort('git %s error %d' % (command, p.returncode)) |
657 |
655 |
658 return retdata, p.returncode |
656 return retdata, p.returncode |