ide: git adjustments

This commit is contained in:
Mirek Fidler 2023-06-06 14:24:35 +02:00
parent 5bf43e2ea4
commit e7eba7de35
3 changed files with 8 additions and 18 deletions

View file

@ -131,22 +131,13 @@ bool GetCredentials(const String& url, const String& dir, String& username, Stri
int best = 0;
if(LoadCredentials(cr)) {
for(const Credential& c : cr) {
for(int pass = 0; pass < 2; pass++) {
const String& u = pass ? url : dir;
int n = min(u.GetCount(), c.url.GetCount());
int ml;
for(ml = 0; ml < n; ml++)
if(u[ml] != c.url[ml])
break;
if(ml > best) {
best = ml;
username = c.username;
password = c.password;
}
if(url.StartsWith(c.url) || dir.StartsWith(c.url)) {
username = c.username;
password = c.password;
}
}
}
return best;
return false;
}
struct CredentialDlg : WithCredentialLayout<TopWindow> {

View file

@ -317,7 +317,6 @@ void RepoSync::SyncList()
o.pull = Default("pull");
actions = ListGit(path);
if(!actions) {
o.push = false;
o.commit.Disable();
}
}

View file

@ -28,10 +28,10 @@ LAYOUT(SvnOptionsLayout, 140, 16)
ITEM(Upp::Option, update, SetLabel(t_("Update")).LeftPosZ(72, 68).VCenterPosZ(16, 0))
END_LAYOUT
LAYOUT(GitOptionsLayout, 164, 16)
ITEM(Upp::Option, commit, SetLabel(t_("Commit")).LeftPosZ(4, 68).VCenterPosZ(16, 0))
ITEM(Upp::Option, pull, SetLabel(t_("Pull(ff)")).LeftPosZ(64, 48).VCenterPosZ(16, 0))
ITEM(Upp::Option, push, SetLabel(t_("Push")).LeftPosZ(116, 48).VCenterPosZ(16, 0))
LAYOUT(GitOptionsLayout, 180, 16)
ITEM(Upp::Option, commit, SetLabel(t_("Commit")).LeftPosZ(0, 68).VCenterPosZ(16, 0))
ITEM(Upp::Option, pull, SetLabel(t_("Pull(rebase)")).LeftPosZ(60, 72).VCenterPosZ(16, 0))
ITEM(Upp::Option, push, SetLabel(t_("Push")).LeftPosZ(132, 48).VCenterPosZ(16, 0))
END_LAYOUT
LAYOUT(CredentialLayout, 368, 140)