chore: git server plumbing (v2)
+ 7
- 4
app/services/gitServer/onPushEvent.ts
@@ -81,6 +81,9 @@ const makeOnPushEvent: ServiceMethodFactory<
           ? `${repoUrlPrefix}/${repoUrlSuffix}`
           : `${repoUrlPrefix}:${Env.PORT}/${repoUrlSuffix}`;
 
+      // Finally, accept the payload from client
+      message.accept();
+
       if (data.payload != null) {
         message.write(toAscii(`Hey ${data.username}, welcome back 🖖.\n\n`));
         message.write(toAscii(`📖 See the details of your push at:\n`));

...
@@ -117,17 +120,17 @@ const makeOnPushEvent: ServiceMethodFactory<
 
       message.write("\n");
     } else if (data.packType === GitServer.PackType.UPLOAD) {
+      // Finally, accept the payload from client
+      message.accept();
+
       // client has done something like "git clone" or "git fetch" or "git pull",
       // it is receiving, server is uploading
       console.log("upload-pack");
       // ⬇️ disabled because it seem to cause issues on git pull. ⬇️
-      // message.write(toAscii(`🖖 Welcome at GitFOSS ${data.username}!\n`));
+      message.write(toAscii(`🖖 Welcome at GitFOSS ${data.username}!\n`));
 
       console.log("upload-pack:", data, message);
     }
-
-    // Finally, accept the payload from client
-    message.accept();
   };
 };