From: Andy Parkins Date: Tue, 27 Feb 2007 12:49:09 +0000 (+0000) Subject: cvsserver: Remove trailing "\n" from commithash in checkin function X-Git-Tag: v1.5.1-rc1~124 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1872adabccdd904f31f16276b147c63fa03079d4;p=git.git cvsserver: Remove trailing "\n" from commithash in checkin function The commithash for updating the ref is obtained from a call to git-commit-tree. However, it was returned (and stored) with the trailing newline. This meant that the later call to git-update-ref that was trying to update to $commithash was including the newline in the parameter - obviously that hash would never exist, and so git-update-ref would always fail. The solution is to chomp() the commithash as soon as it is returned by git-commit-tree. Signed-off-by: Andy Parkins Signed-off-by: Junio C Hamano --- diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 8e12f81e2..8db6e23c5 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -1152,6 +1152,7 @@ sub req_ci close $msg_fh; my $commithash = `git-commit-tree $treehash -p $parenthash < $msg_filename`; + chomp($commithash); $log->info("Commit hash : $commithash"); unless ( $commithash =~ /[a-zA-Z0-9]{40}/ )