Skip to content

Commit 84da035

Browse files
author
Junio C Hamano
committed
Merge branch 'maint'
* maint: Catch write_ref_sha1 failure in receive-pack make t8001 work on Mac OS X again
2 parents dc49cd7 + ef203f0 commit 84da035

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

receive-pack.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ static int update(struct command *cmd)
158158
cmd->error_string = "failed to lock";
159159
return error("failed to lock %s", name);
160160
}
161-
write_ref_sha1(lock, new_sha1, "push");
161+
if (write_ref_sha1(lock, new_sha1, "push")) {
162+
cmd->error_string = "failed to write";
163+
return -1; /* error() already called */
164+
}
162165
fprintf(stderr, "%s: %s -> %s\n", name, old_hex, new_hex);
163166
}
164167
return 0;

t/annotate-tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ test_expect_success \
114114
test_expect_success \
115115
'some edit' \
116116
'mv file file.orig &&
117-
sed -e "s/^3A/99/" -e "/^1A/d" < file.orig > file &&
117+
sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" < file.orig > file &&
118+
echo "incomplete" | tr -d "\\012" >>file &&
118119
GIT_AUTHOR_NAME="D" git commit -a -m "edit"'
119120

120121
test_expect_success \

0 commit comments

Comments
 (0)