Commit 55a5c8d
commit.c: check for lock error and return early
Move the check for the lock failure to happen immediately after
lock_any_ref_for_update(). Previously the lock and the
check-if-lock-failed was separated by a handful of string
manipulation statements.
Moving the check to occur immediately after the failed lock makes
the code slightly easier to read and makes it follow the pattern of
try-to-take-a-lock();
if (check-if-lock-failed) {
error();
}
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 651ab9f commit 55a5c8d
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1672 | 1672 | | |
1673 | 1673 | | |
1674 | 1674 | | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
1675 | 1679 | | |
1676 | 1680 | | |
1677 | 1681 | | |
| |||
1681 | 1685 | | |
1682 | 1686 | | |
1683 | 1687 | | |
1684 | | - | |
1685 | | - | |
1686 | | - | |
1687 | | - | |
1688 | 1688 | | |
1689 | 1689 | | |
1690 | 1690 | | |
| |||
0 commit comments