mirror of
https://github.com/frej/fast-export.git
synced 2026-03-04 01:00:43 +01:00
hg2git.py: Don't complain die for non-existent heads
Previously, when no head was present under .git/refs/heads, we simply died as we couldn't open the file. Now, simply return None in case we cannot read from it. Signed-off-by: Rocco Rutte <pdmef@gmx.net>
This commit is contained in:
11
hg2git.py
11
hg2git.py
@@ -307,10 +307,13 @@ def save_cache(filename,cache):
|
||||
|
||||
def verify_heads(ui,repo,cache):
|
||||
def getsha1(branch):
|
||||
f=open(os.getenv('GIT_DIR','/dev/null')+'/refs/heads/'+branch)
|
||||
sha1=f.readlines()[0].split('\n')[0]
|
||||
f.close()
|
||||
return sha1
|
||||
try:
|
||||
f=open(os.getenv('GIT_DIR','/dev/null')+'/refs/heads/'+branch)
|
||||
sha1=f.readlines()[0].split('\n')[0]
|
||||
f.close()
|
||||
return sha1
|
||||
except IOError:
|
||||
return None
|
||||
|
||||
# get list of hg's branches to verify, don't take all git has
|
||||
branches=repo.branchtags()
|
||||
|
||||
Reference in New Issue
Block a user