lib/repo-commit: Import detached metadata even if hardlink exists
authorPhilip Withnall <withnall@endlessm.com>
Tue, 3 Oct 2017 14:45:34 +0000 (15:45 +0100)
committerSimon McVittie <smcv@debian.org>
Tue, 3 Oct 2017 21:47:48 +0000 (22:47 +0100)
Spotted while reading through the code, it looks like the
copy_detached_metadata() call is accidentally omitted if a hardlink
already exists for the .commit object.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1242
Approved by: cgwalters
Origin: upstream, 2017.13, commit:86e072bdbe48a4f16efb05c00eb79114e5fdbf61

Gbp-Pq: Topic 2017.13
Gbp-Pq: Name lib-repo-commit-Import-detached-metadata-even-if-hardlink.patch

src/libostree/ostree-repo-commit.c

index c4484f44b9e95a0606ad3ff811d1287206e472dd..76bc187e4c3a941a2816450bbf2644eafd3952e3 100644 (file)
@@ -3255,7 +3255,7 @@ import_one_object_direct (OstreeRepo    *dest_repo,
       if (linkat (src_repo->objects_dir_fd, loose_path_buf, dest_dfd, loose_path_buf, 0) != 0)
         {
           if (errno == EEXIST)
-            return TRUE;
+            did_hardlink = TRUE;
           else if (errno == EMLINK || errno == EXDEV || errno == EPERM)
             {
               /* EMLINK, EXDEV and EPERM shouldn't be fatal; we just can't do