File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -861,6 +861,16 @@ fn fetch_remote_impl(
861861 let mut fetch_options = git2:: FetchOptions :: new ( ) ;
862862 fetch_options. remote_callbacks ( callbacks) ;
863863
864+ // Configure fetch options to handle tag conflicts properly
865+ // PRUNE: Remove remote-tracking references that no longer exist on the remote
866+ // UPDATE_FETCHHEAD: Update FETCH_HEAD to the latest fetched commit
867+ fetch_options. prune ( git2:: FetchPrune :: On ) ;
868+ fetch_options. update_fetchhead ( true ) ;
869+
870+ // Tags: Fetch all tags and handle conflicts by force updating
871+ // This is similar to git's --tags --force behavior
872+ fetch_options. download_tags ( git2:: AutotagOption :: All ) ;
873+
864874 // Perform the fetch
865875 // Default refspec is usually configured for the remote, so we can pass empty refspec list to use default
866876 remote_obj. fetch ( & [ ] as & [ & str ] , Some ( & mut fetch_options) , None ) ?;
You can’t perform that action at this time.
0 commit comments