aboutsummaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-08-12 16:36:04 -0700
committerJunio C Hamano <gitster@pobox.com>2009-08-12 16:36:04 -0700
commit6ffd781226f04629eff63a684b47ad7555143312 (patch)
treee41ea02c886afd117f51b257d57f84043e447efd /transport.c
parent19a7fcbf16276321f83e0c1748b3935a2ea42675 (diff)
parent2cd9c2aff0d65bbce704a68d9cbe7a17e02257fe (diff)
downloadgit-6ffd781226f04629eff63a684b47ad7555143312.tar.gz
git-6ffd781226f04629eff63a684b47ad7555143312.tar.xz
Merge branch 'maint'
* maint: push: point to 'git pull' and 'git push --force' in case of non-fast forward Documentation: add: <filepattern>... is optional Change mentions of "git programs" to "git commands" Documentation: merge: one <remote> is required help.c: give correct structure's size to memset()
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/transport.c b/transport.c
index afec5b731..faee154c3 100644
--- a/transport.c
+++ b/transport.c
@@ -821,7 +821,7 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i
}
static void print_push_status(const char *dest, struct ref *refs,
- int verbose, int porcelain)
+ int verbose, int porcelain, int * nonfastforward)
{
struct ref *ref;
int n = 0;
@@ -836,11 +836,14 @@ static void print_push_status(const char *dest, struct ref *refs,
if (ref->status == REF_STATUS_OK)
n += print_one_push_status(ref, dest, n, porcelain);
+ *nonfastforward = 0;
for (ref = refs; ref; ref = ref->next) {
if (ref->status != REF_STATUS_NONE &&
ref->status != REF_STATUS_UPTODATE &&
ref->status != REF_STATUS_OK)
n += print_one_push_status(ref, dest, n, porcelain);
+ if (ref->status == REF_STATUS_REJECT_NONFASTFORWARD)
+ *nonfastforward = 1;
}
}
@@ -999,7 +1002,8 @@ int transport_set_option(struct transport *transport,
}
int transport_push(struct transport *transport,
- int refspec_nr, const char **refspec, int flags)
+ int refspec_nr, const char **refspec, int flags,
+ int * nonfastforward)
{
verify_remote_names(refspec_nr, refspec);
@@ -1029,7 +1033,8 @@ int transport_push(struct transport *transport,
if (!quiet || push_had_errors(remote_refs))
print_push_status(transport->url, remote_refs,
- verbose | porcelain, porcelain);
+ verbose | porcelain, porcelain,
+ nonfastforward);
if (!(flags & TRANSPORT_PUSH_DRY_RUN)) {
struct ref *ref;