merge remote detection logic and add some more leniency in parsing remotes
merge remote detection logic and add some more leniency in parsing remotes

beni55/ploy,substack/ploy,beni55/ploy,substack/ploy