@matheusbsbs / matheus-bagliano / commits / 1872adabcc
Fork 0

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 <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Andy Parkins committed Feb 27, 2007 at 12:49 UTC 1872adabccdd904f31f16276b147c63fa03079d4
1 file changed +1
git-cvsserver.perl
+1
@@ -1152,6 +1152,7 @@ sub req_ci
1152 close $msg_fh;
1153
1154 my $commithash = `git-commit-tree $treehash -p $parenthash < $msg_filename`;
1155 + chomp($commithash);
1156 $log->info("Commit hash : $commithash");
1157
1158 unless ( $commithash =~ /[a-zA-Z0-9]{40}/ )