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
This commit is contained in:
Joey Hess 2023-02-10 14:33:21 -04:00
parent fb93fbc564
commit bb4550c7c1
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 6 additions and 1 deletions

View file

@ -490,7 +490,9 @@ propigateAdjustedCommits' origbranch adj _commitsprevented =
, rebase currcommit newparent , rebase currcommit newparent
) )
Nothing -> return (Nothing, return ()) 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 where
(BasisBranch basis) = basisBranch adjbranch (BasisBranch basis) = basisBranch adjbranch
adjbranch@(AdjBranch currbranch) = originalToAdjusted origbranch adj adjbranch@(AdjBranch currbranch) = originalToAdjusted origbranch adj

View file

@ -13,6 +13,8 @@ git-annex (10.20230127) UNRELEASED; urgency=medium
changes that have been made to the parent branch or metadata. changes that have been made to the parent branch or metadata.
* Support http urls that contain ":" that is not followed by a port * Support http urls that contain ":" that is not followed by a port
number, the same as git does. 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 <id@joeyh.name> Mon, 06 Feb 2023 13:39:18 -0400 -- Joey Hess <id@joeyh.name> Mon, 06 Feb 2023 13:39:18 -0400

View file

@ -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) ### 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]]