commit 62145ffa9063405ac4cabace2a9093d05099d5ee
parent 6e05c6bd2fb5a59035abe657e1888fed1877566d
Author: Remy Noulin <loader2x@gmail.com>
Date: Sat, 11 Feb 2017 13:43:21 +0100
fix bug when there is nothing to push
and everything up-to-date
c/git-off.c | 4 ++++
c/gitoff.c | 4 ++++
2 files changed, 8 insertions(+)
Diffstat:
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/c/git-off.c b/c/git-off.c
@@ -2117,6 +2117,10 @@ void offCommands_prepush() {
offHelpers_setTransport_mode();
read = getline(&line, &len, stdin);
+ if (read == -1) {
+ // exit directly when there is nothing to do
+ exit(EXIT_SUCCESS);
+ }
while (read != -1) {
{
char* pos = NULL;
diff --git a/c/gitoff.c b/c/gitoff.c
@@ -2116,6 +2116,10 @@ void offCommands_prepush() {
offHelpers_setTransport_mode();
read = getline(&line, &len, stdin);
+ if (read == -1) {
+ // exit directly when there is nothing to do
+ exit(EXIT_SUCCESS);
+ }
while (read != -1) {
{
char* pos = NULL;