subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1717649 - /subversion/branches/ra-git/subversion/libsvn_fs_git/gitdb.c
Date Wed, 02 Dec 2015 15:29:59 GMT
Author: rhuijben
Date: Wed Dec  2 15:29:58 2015
New Revision: 1717649

URL: http://svn.apache.org/viewvc?rev=1717649&view=rev
Log:
On the ra-git branch: Fix a problem with the checksums that made
$ svnadmin dump <git-repos> | svnadmin load <empty-repos>
fail

* subversion/libsvn_fs_git/gitdb.c
  (db_fetch_checksum,
  svn_fs_git__db_fetch_checksum): Really return the requested checksum kind.

Modified:
    subversion/branches/ra-git/subversion/libsvn_fs_git/gitdb.c

Modified: subversion/branches/ra-git/subversion/libsvn_fs_git/gitdb.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_git/gitdb.c?rev=1717649&r1=1717648&r2=1717649&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_git/gitdb.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_git/gitdb.c Wed Dec  2 15:29:58 2015
@@ -227,7 +227,7 @@ db_fetch_checksum(svn_checksum_t **check
   SVN_ERR(svn_sqlite__bind_checksum(stmt, 3, sha1_checksum, scratch_pool));
   SVN_ERR(svn_sqlite__update(NULL, stmt));
 
-  if (idx == 1)
+  if (idx == 0)
     *checksum = svn_checksum_dup(md5_checksum, result_pool);
   else
     *checksum = svn_checksum_dup(sha1_checksum, result_pool);
@@ -243,19 +243,14 @@ svn_fs_git__db_fetch_checksum(svn_checks
                               apr_pool_t *scratch_pool)
 {
   svn_fs_git_fs_t *fgf = fs->fsap_data;
-  int idx;
 
-  if (kind == svn_checksum_md5)
-    idx = 1;
-  else if (kind == svn_checksum_sha1)
-    idx = 2;
-  else
+  if (kind != svn_checksum_md5 && kind != svn_checksum_sha1)
     {
-      *checksum = NULL;
+      checksum = NULL;
       return SVN_NO_ERROR;
     }
 
-  SVN_SQLITE__WITH_LOCK(db_fetch_checksum(checksum, fs, oid, idx,
+  SVN_SQLITE__WITH_LOCK(db_fetch_checksum(checksum, fs, oid, (kind + 0),
                                           result_pool, scratch_pool),
                         fgf->sdb);
 



Mime
View raw message