Mercurial > hg-git
comparison hggit/git_handler.py @ 1102:93cb29247d61
exchange: check for remote refs to determine if we're cloning
The exchange.pull wrapper function was checking whether any paths were
configured yet as a proxy to determine whether we're doing the initial
clone or a subsequent pull. Core hg @ bdae51a83dfb (released in 4.5) now
sets the 'default' path on the ui object before exchange.pull is called,
but we can check a bit more directly by checking if we have any remote
refs yet. This is the same as a check we do in GitHandler.fetch_pack().
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Sat, 03 Feb 2018 14:54:35 -0600 |
parents | 843f409526fb |
children | e326b349eba6 |
comparison
equal
deleted
inserted
replaced
1101:843f409526fb | 1102:93cb29247d61 |
---|---|
296 rhead = None | 296 rhead = None |
297 rnode = None | 297 rnode = None |
298 | 298 |
299 if remote_name: | 299 if remote_name: |
300 self.update_remote_branches(remote_name, result.refs) | 300 self.update_remote_branches(remote_name, result.refs) |
301 elif not self.paths: | 301 elif not self.git.refs.as_dict('refs/remotes/'): |
302 # intial cloning | 302 # intial cloning |
303 self.update_remote_branches('default', result.refs) | 303 self.update_remote_branches('default', result.refs) |
304 | 304 |
305 # "Activate" a tipmost bookmark. | 305 # "Activate" a tipmost bookmark. |
306 bms = self.repo['tip'].bookmarks() | 306 bms = self.repo['tip'].bookmarks() |