Resolves #154 input escaping issue when accessing remote branch locally to push remote, fixed others too

This commit is contained in:
Peter Cottle 2014-01-06 10:04:03 -08:00
parent 0bb6133f87
commit f952bd7061
2 changed files with 18 additions and 4 deletions

View file

@ -48,7 +48,7 @@ var assertNotCheckedOut = function(engine, ref) {
var assertIsBranch = function(engine, ref) {
assertIsRef(engine, ref);
var obj = engine.refs[ref];
var obj = engine.resolveID(ref);
if (!obj || obj.get('type') !== 'branch') {
throw new GitError({
msg: intl.todo(
@ -60,7 +60,7 @@ var assertIsBranch = function(engine, ref) {
var assertIsRemoteBranch = function(engine, ref) {
assertIsRef(engine, ref);
var obj = engine.refs[ref];
var obj = engine.resolveID(ref);
if (obj.get('type') !== 'branch' ||
!obj.getIsRemote()) {
@ -87,7 +87,7 @@ var assertOriginSpecified = function(generalArgs) {
var assertBranchIsRemoteTracking = function(engine, branchName) {
branchName = crappyUnescape(branchName);
if (!engine.refs[branchName]) {
if (!engine.resolveID(branchName)) {
throw new GitError({
msg: intl.todo(branchName + ' is not a branch!')
});
@ -697,7 +697,7 @@ var commandConfig = {
// can be created on demand but we at least need this to be a source
// locally otherwise we will fail
assertIsRef(engine, firstArg);
sourceObj = engine.refs[firstArg];
sourceObj = engine.resolveID(firstArg);
} else {
// since they have not specified a source or destination, then
// we source from the branch we are on (or HEAD)