From fbc7f6db25c322ea0da0a13d080d07b84f8bc497 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 14 Feb 2018 00:38:22 +0300 Subject: Make git_clone() to abbreviate (16 chars) commit id-based directory name --- tests/rep-fetch-git-commit.test | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'tests/rep-fetch-git-commit.test') diff --git a/tests/rep-fetch-git-commit.test b/tests/rep-fetch-git-commit.test index ced0f8f..e2752b6 100644 --- a/tests/rep-fetch-git-commit.test +++ b/tests/rep-fetch-git-commit.test @@ -8,7 +8,7 @@ reason_unadv = ' (unadvertised commit)' warn_dumb=' warning: fetching over dumb HTTP, no progress will be shown' - +git clone "$rep_git/state0/style-basic.git" 2>! &style-basic/*** ++git clone "$rep_git/state0/style-basic.git" 2>! &style-basic/*** : unadvertised : @@ -16,6 +16,10 @@ warning: fetching over dumb HTTP, no progress will be shown' +git -C ../style-basic log '--pretty=format:%H' --all --grep='README' | \ set commit + +git -C ../style-basic log '--pretty=format:%h' --all --grep='README' \ + --abbrev=16 | \ + set abbr_commit + : no-branch : { @@ -23,7 +27,7 @@ warning: fetching over dumb HTTP, no progress will be shown' if ($git_protocol == 'https-smart-unadv') warn = '%.{0}' - fetch = "%Fetching in '.+$commit'.+%" + fetch = "%Fetching in '.+$abbr_commit'.+%" else warn = "warning: fetching whole repository history" @@ -39,7 +43,7 @@ warning: fetching over dumb HTTP, no progress will be shown' $* 2>>~"%EOE%" %fetching git:.+style-basic% $warn - %Cloning into '.+$commit'.+% + %Cloning into '.+$abbr_commit'.+% $fetch 0 package\(s\) in 1 repository\(s\) EOE @@ -91,13 +95,13 @@ warning: fetching over dumb HTTP, no progress will be shown' fetch = '%.{0}' else warn = '%.{0}' - fetch = "%Fetching in '.+$commit'.+%" + fetch = "%Fetching in '.+$abbr_commit'.+%" end; $* 2>>~"%EOE%" %fetching git:.+style-basic% $warn - %Cloning into '.+$commit'.+% + %Cloning into '.+$abbr_commit'.+% $fetch 0 package\(s\) in 1 repository\(s\) EOE -- cgit v1.1