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)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 3 Oct 2017 16:31:13 +0000 (16:31 +0000)
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

src/libostree/ostree-repo-commit.c

index 0bf4078b69ef8cc303fc5cc5b6d1f8ba0ada6568..0060120fb4197dfac9730e178f1ee8a1063f13a1 100644 (file)
@@ -3319,7 +3319,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