Skip to content

Commit

Permalink
cvsserver: Remove trailing "\n" from commithash in checkin function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Parkins authored and Junio C Hamano committed Feb 27, 2007
1 parent ada5ef3 commit 1872ada
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions git-cvsserver.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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}/ )
Expand Down

0 comments on commit 1872ada

Please sign in to comment.