Skip to content

Commit e0c91cf

Browse files
felipecgitster
authored andcommitted
push: only check same_remote when needed
Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c5b09cf commit e0c91cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builtin/push.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ static const char *get_upstream_ref(struct branch *branch, const char *remote_na
205205
static void setup_default_push_refspecs(struct remote *remote)
206206
{
207207
struct branch *branch;
208-
int same_remote = remote == remote_get(NULL);
209208
const char *dst;
209+
int same_remote;
210210

211211
switch (push_default) {
212212
case PUSH_DEFAULT_MATCHING:
@@ -226,6 +226,7 @@ static void setup_default_push_refspecs(struct remote *remote)
226226
die(_(message_detached_head_die), remote->name);
227227

228228
dst = branch->refname;
229+
same_remote = remote == remote_get(NULL);
229230

230231
switch (push_default) {
231232
default:

0 commit comments

Comments
 (0)