diff --git a/builtin-push.c b/builtin-push.c
index 5df66081a6ff0ca5087ff9a2ac4042d8ec651499..f7bc2b292fb85725d9cc26ce09f2302aaa7167fe 100644 (file)
--- a/builtin-push.c
+++ b/builtin-push.c
} else if (deleterefs && !strchr(ref, ':')) {
char *delref;
int len = strlen(ref)+1;
- delref = xmalloc(len);
+ delref = xmalloc(len+1);
strcpy(delref, ":");
strcat(delref, ref);
ref = delref;
struct branch *branch = branch_get(NULL);
if (!branch)
die("You are not currently on a branch.");
- if (!branch->merge_nr)
+ if (!branch->merge_nr || !branch->merge)
die("The current branch %s is not tracking anything.",
branch->name);
if (branch->merge_nr != 1)