Code

cvsserver: Remove trailing "\n" from commithash in checkin function
authorAndy Parkins <andyparkins@gmail.com>
Tue, 27 Feb 2007 12:49:09 +0000 (12:49 +0000)
committerJunio C Hamano <junkio@cox.net>
Tue, 27 Feb 2007 23:51:03 +0000 (15:51 -0800)
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 <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-cvsserver.perl

index 8e12f81e20f67ad1e5e94fd55e696286b94eef98..8db6e23c5517f62de8019a3a4a881adba628a689 100755 (executable)
@@ -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}/ )