瀏覽代碼

git-pre-push-hook: remove ".git" from URL.

Ryan C. Gordon 4 年之前
父節點
當前提交
db2ad6fa73
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      build-scripts/git-pre-push-hook.pl

+ 1 - 0
build-scripts/git-pre-push-hook.pl

@@ -27,6 +27,7 @@ my $url = $ARGV[1];
 #print("remote: $remote\n");
 #print("remote: $remote\n");
 #print("url: $url\n");
 #print("url: $url\n");
 
 
+$url =~ s/\.git$//;  # change myorg/myproject.git to myorg/myproject
 $url =~ s#^git\@github\.com\:#https://github.com/#i;
 $url =~ s#^git\@github\.com\:#https://github.com/#i;
 my $commiturl = $url =~ /\Ahttps?:\/\/github.com\// ? "$url/commit/" : '';
 my $commiturl = $url =~ /\Ahttps?:\/\/github.com\// ? "$url/commit/" : '';