From 58db64f73c3dedb41467f915b45d305d52d04d2c Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 6 Mar 2007 19:48:59 -0500 Subject: make t8001 work on Mac OS X again The test was recently broken to expect sed to leave the incomplete line at the end without newline. POSIX says that output of the pattern space is to be followed by a newline, while GNU adds the newline back only when it was stripped when input. GNU behaviour is arguably more intuitive and nicer, but we should not depend on it. Signed-off-by: Johannes Schindelin Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh index 87403da..cacb273 100644 --- a/t/annotate-tests.sh +++ b/t/annotate-tests.sh @@ -114,7 +114,8 @@ test_expect_success \ test_expect_success \ 'some edit' \ 'mv file file.orig && - sed -e "s/^3A/99/" -e "/^1A/d" < file.orig > file && + sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" < file.orig > file && + echo "incomplete" | tr -d "\\012" >>file && GIT_AUTHOR_NAME="D" git commit -a -m "edit"' test_expect_success \ -- cgit v0.10.2-6-g49f6 From ef203f08564c1c6d267fedf8e0357c56d477892f Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Wed, 7 Mar 2007 12:04:24 -0500 Subject: Catch write_ref_sha1 failure in receive-pack This failure to catch the failure of write_ref_sha1 was noticed by Bill Lear. The ref will not update if the log file could not be appended to (due to file permissions problems). Such a failure should be flagged as a failure to update the ref, so that the client knows the push did not succeed. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano diff --git a/receive-pack.c b/receive-pack.c index 7311c82..ea6872e 100644 --- a/receive-pack.c +++ b/receive-pack.c @@ -158,7 +158,10 @@ static int update(struct command *cmd) cmd->error_string = "failed to lock"; return error("failed to lock %s", name); } - write_ref_sha1(lock, new_sha1, "push"); + if (write_ref_sha1(lock, new_sha1, "push")) { + cmd->error_string = "failed to write"; + return -1; /* error() already called */ + } fprintf(stderr, "%s: %s -> %s\n", name, old_hex, new_hex); } return 0; -- cgit v0.10.2-6-g49f6