Skip to contentSkip to conversation

Associate 'git gui clone' with the git:// protocol

PATCH New Petr Baudis 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Associate 'git gui clone' with the git:// protocol

This MSysGit patch makes the installer register 'git gui clone' as the Git URL protocol handler. This depends on the 'git gui clone' functionality itself, of course - currently in the process of getting accepted upstream (hopefully).

---

Sorry if the line offsets are a bit off.

share/WinGit/install.iss +10 -0
index 05fdae6..82e8ecf 100644
@@ -484,6 +484,16 @@ begin
             // so we continue.
         end;
     end;
+
+    if (not RegWriteStringValue(HKEY_CLASSES_ROOT,'git','','URL:Git Protocol'))
+    or (not RegWriteStringValue(HKEY_CLASSES_ROOT,'git','URL Protocol',''))
+    or (not RegWriteStringValue(HKEY_CLASSES_ROOT,'git\shell\open\command','','"'+AppDir+'\bin\wish.exe" "'+AppDir+'\bin\git-gui" "clone" "%1"')) then begin
+        Msg:='Line {#emit __LINE__}: Unable to set up the "git://" URL protocol handler.';
+        MsgBox(Msg,mbError,MB_OK);
+        Log(Msg);
+        // This is not a critical error, the user can probably fix it manually,
+        // so we continue.
+    end;
 end;
 
 {