@@ -59,6 +59,11 @@ def test_git_get_config_multiline(self, popen):
5959 return_value = (
6060 b"user.name=John Snow\n "
6161 b"user.email=john.snow@iscoming.com\n "
62+ b'alias.summary=!f() { printf "Summary of this branch...\n '
63+ b'"; printf "%s\n '
64+ b'" $(git rev-parse --abbrev-ref HEAD); printf "\n '
65+ b"Most-active files, with churn count\n "
66+ b'"; git churn | head -7; }; f\n '
6267 b'alias.topic-base-branch-name=!f(){ printf "master\n '
6368 b'"; };f\n '
6469 b'alias.topic-start=!f(){ topic_branch="$1"; git topic-create "$topic_branch"; git topic-push; };f' ,
@@ -94,7 +99,10 @@ def test_git_get_config_multiline(self, popen):
9499 }
95100
96101 @patch ("subprocess.Popen" )
97- @patch ("jupyterlab_git.git.ALLOWED_OPTIONS" , ["user.name" , "alias.topic-base-branch-name" ])
102+ @patch (
103+ "jupyterlab_git.git.ALLOWED_OPTIONS" ,
104+ ["alias.summary" , "alias.topic-base-branch-name" ],
105+ )
98106 def test_git_get_config_accepted_multiline (self , popen ):
99107 # Given
100108 process_mock = Mock ()
@@ -103,6 +111,11 @@ def test_git_get_config_accepted_multiline(self, popen):
103111 return_value = (
104112 b"user.name=John Snow\n "
105113 b"user.email=john.snow@iscoming.com\n "
114+ b'alias.summary=!f() { printf "Summary of this branch...\n '
115+ b'"; printf "%s\n '
116+ b'" $(git rev-parse --abbrev-ref HEAD); printf "\n '
117+ b"Most-active files, with churn count\n "
118+ b'"; git churn | head -7; }; f\n '
106119 b'alias.topic-base-branch-name=!f(){ printf "master\n '
107120 b'"; };f\n '
108121 b'alias.topic-start=!f(){ topic_branch="$1"; git topic-create "$topic_branch"; git topic-push; };f' ,
@@ -132,8 +145,12 @@ def test_git_get_config_accepted_multiline(self, popen):
132145 assert payload == {
133146 "code" : 0 ,
134147 "options" : {
135- "user.name" : "John Snow" ,
136- "alias.topic-base-branch-name" : '!f(){ printf "master"; };f' ,
148+ "alias.summary" : '!f() { printf "Summary of this branch...\n '
149+ '"; printf "%s\n '
150+ '" $(git rev-parse --abbrev-ref HEAD); printf "\n '
151+ "Most-active files, with churn count\n "
152+ '"; git churn | head -7; }; f' ,
153+ "alias.topic-base-branch-name" : '!f(){ printf "master\n "; };f' ,
137154 },
138155 }
139156
0 commit comments