From bb4550c7c1c7ed58bc2958d2408d8e6f6adae357 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Feb 2023 14:33:21 -0400 Subject: [PATCH] sync: Warn when the adjusted basis ref cannot be found As happens eg when the user has renamed branches. Sponsored-by: Graham Spencer on Patreon --- Annex/AdjustedBranch.hs | 4 +++- CHANGELOG | 2 ++ ...d__47__main__40__unlocked__41___not_syncing_with_main.mdwn | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Annex/AdjustedBranch.hs b/Annex/AdjustedBranch.hs index 4a55d4647a..af3d46aae6 100644 --- a/Annex/AdjustedBranch.hs +++ b/Annex/AdjustedBranch.hs @@ -490,7 +490,9 @@ propigateAdjustedCommits' origbranch adj _commitsprevented = , rebase currcommit newparent ) Nothing -> return (Nothing, return ()) - Nothing -> return (Nothing, return ()) + Nothing -> do + warning $ "Cannot find basis ref " ++ fromRef basis ++ "; not propagating adjusted commits to original branch " ++ fromRef origbranch + return (Nothing, return ()) where (BasisBranch basis) = basisBranch adjbranch adjbranch@(AdjBranch currbranch) = originalToAdjusted origbranch adj diff --git a/CHANGELOG b/CHANGELOG index 4d9d5f0e98..ba3ecc9ec0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,8 @@ git-annex (10.20230127) UNRELEASED; urgency=medium changes that have been made to the parent branch or metadata. * Support http urls that contain ":" that is not followed by a port number, the same as git does. + * sync: Warn when the adjusted basis ref cannot be found, as happens eg when + the user has renamed branches. -- Joey Hess Mon, 06 Feb 2023 13:39:18 -0400 diff --git a/doc/bugs/adjusted__47__main__40__unlocked__41___not_syncing_with_main.mdwn b/doc/bugs/adjusted__47__main__40__unlocked__41___not_syncing_with_main.mdwn index 10475abd33..88b0db994d 100644 --- a/doc/bugs/adjusted__47__main__40__unlocked__41___not_syncing_with_main.mdwn +++ b/doc/bugs/adjusted__47__main__40__unlocked__41___not_syncing_with_main.mdwn @@ -62,3 +62,4 @@ local repository version: 10 ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders) +> Added a warning message in this situation. [[done]] --[[Joey]]