From: Matthias Kestenholz <lists@irregular•ch>
To: Junio C Hamano <junkio@cox•net>
Cc: git@vger•kernel.org
Subject: Re: Bug encountered while comitting
Date: Sat, 25 Mar 2006 11:23:15 +0100 [thread overview]
Message-ID: <20060325102314.GA3825@spinlock.ch> (raw)
In-Reply-To: <7vwtejxd3u.fsf@assigned-by-dhcp.cox.net>
* Junio C Hamano (junkio@cox•net) wrote:
> You are right. commit-tree does not seem to check if it
> successfully wrote the commit object. How about this?
>
> -- >8 --
> diff --git a/commit-tree.c b/commit-tree.c
> index 88871b0..16c1787 100644
> --- a/commit-tree.c
> +++ b/commit-tree.c
> @@ -125,7 +125,10 @@ int main(int argc, char **argv)
> while (fgets(comment, sizeof(comment), stdin) != NULL)
> add_buffer(&buffer, &size, "%s", comment);
>
> - write_sha1_file(buffer, size, "commit", commit_sha1);
> - printf("%s\n", sha1_to_hex(commit_sha1));
> - return 0;
> + if (!write_sha1_file(buffer, size, "commit", commit_sha1)) {
> + printf("%s\n", sha1_to_hex(commit_sha1));
> + return 0;
> + }
> + else
> + return 1;
> }
This patch fixes the problem I was encountering (git-update-ref is
not executed anymore).
Thank you all for this really great tool!
--
:wq
prev parent reply other threads:[~2006-03-25 10:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-24 18:39 Bug encountered while comitting Matthias Kestenholz
2006-03-24 19:34 ` Andreas Ericsson
2006-03-25 1:15 ` Matthias Kestenholz
2006-03-24 22:55 ` Junio C Hamano
2006-03-25 1:15 ` Matthias Kestenholz
2006-03-25 6:17 ` Junio C Hamano
2006-03-25 10:23 ` Matthias Kestenholz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060325102314.GA3825@spinlock.ch \
--to=lists@irregular$(echo .)ch \
--cc=git@vger$(echo .)kernel.org \
--cc=junkio@cox$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox