[前][次][番号順一覧][スレッド一覧]

ruby-changes:60175

From: Nobuyoshi <ko1@a...>
Date: Mon, 24 Feb 2020 12:41:37 +0900 (JST)
Subject: [ruby-changes:60175] f8401732de (master): Try with and without "v" prefix for numeric tag

https://git.ruby-lang.org/ruby.git/commit/?id=f8401732de

From f8401732dea7b22c849cefc722d7d7f41f2ddd1b Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 24 Feb 2020 12:40:34 +0900
Subject: Try with and without "v" prefix for numeric tag


diff --git a/tool/fetch-bundled_gems.rb b/tool/fetch-bundled_gems.rb
index 5769a19..28ae3d4 100755
--- a/tool/fetch-bundled_gems.rb
+++ b/tool/fetch-bundled_gems.rb
@@ -9,25 +9,16 @@ BEGIN { https://github.com/ruby/ruby/blob/trunk/tool/fetch-bundled_gems.rb#L9
 }
 
 n, v, u = $F
-case n
-when "test-unit"
-else
-  v = "v" + v
-end
 
 if File.directory?(n)
   puts "updating #{n} ..."
-  if v == "master"
-    system(*%W"git pull", chdir: n) or abort
-  else
-    system(*%W"git fetch", chdir: n) or abort
-  end
+  system("git", (v == "master" ? "pull" : "fetch"), chdir: n) or abort
 else
   puts "retrieving #{n} ..."
   system(*%W"git clone #{u} #{n}") or abort
 end
-unless system(*%W"git checkout #{v}", chdir: n)
-  unless v.sub!(/\Av/, '') and system(*%W"git checkout #{v}", chdir: n)
+unless system(*%W"git checkout #{v.sub(/\A(?=\d)/, 'v')}", chdir: n)
+  unless /\A\d/ =~ v and system(*%W"git checkout #{v}", chdir: n)
     abort
   end
 end
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]