Skip to content

Commit cb29c8f

Browse files
committed
master2main works on Mac
1 parent 7eb2ef3 commit cb29c8f

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

GSASII/GSASIIctrlGUI.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,7 +2643,7 @@ def ShowScrolledInfo(parent,txt,width=600,height=400,header='Warning info',
26432643
btn = wx.Button(dlg, b)
26442644
btn.Bind(wx.EVT_BUTTON,lambda event: dlg.EndModal(event.Id))
26452645
btnsizer.Add(btn)
2646-
btnsizer.Add((3,-1))
2646+
btnsizer.Add((6,-1))
26472647
mainSizer.Add(btnsizer, 0, wx.ALIGN_CENTER|wx.ALL, 5)
26482648
dlg.SetSizer(mainSizer)
26492649
mainSizer.Fit(dlg)
@@ -10351,12 +10351,14 @@ def gitSwitchMaster2Main():
1035110351
G2MessageBox(G2frame,msg,'Local changes')
1035210352

1035310353
return
10354-
# need the ability to update when regressed
10355-
# if g2repo.head.is_detached:
10356-
# G2MessageBox(G2frame,
10357-
# 'You have a old previous version loaded; you must be on a branch head to updateswitching branches',
10358-
# 'Detached head')
10359-
# return
10354+
# Should not get here with detached head (regressed version) need to be on latest (last) version
10355+
# go get into this routine
10356+
if g2repo.head.is_detached:
10357+
G2MessageBox(G2frame,
10358+
'You have a old previous version loaded; you must be on a branch head to updateswitching branches',
10359+
'Detached head')
10360+
return
10361+
# this also should not happen
1036010362
if g2repo.active_branch.name != "master":
1036110363
G2MessageBox(G2frame,
1036210364
f'You are on the {g2repo.active_branch.name} branch. This can only be run from master.',

GSASII/GSASIIpath.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,10 @@ def getG2Branch():
299299
'''
300300
if HowIsG2Installed().startswith('git'):
301301
g2repo = openGitRepo(path2GSAS2)
302-
return g2repo.active_branch.name
302+
try:
303+
return g2repo.active_branch.name
304+
except TypeError: # likely on a detached head
305+
return '?'
303306

304307
def getG2VersionInfo():
305308
'''Get the git version information. This can be a bit slow, so reading

0 commit comments

Comments
 (0)