Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gitg
Commits
7f8203f2
Commit
7f8203f2
authored
Feb 15, 2022
by
Alberto Fanjul
Browse files
Control errors
parent
c4cfc2fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
libgitg/gitg-diff-view.vala
View file @
7f8203f2
...
...
@@ -598,9 +598,9 @@ public class Gitg.DiffView : Gtk.Grid
{
if
(
repository
!=
null
)
{
var
conf
=
repository
.
get_config
().
snapshot
();
try
{
var
conf
=
repository
.
get_config
().
snapshot
();
conf
.
match_foreach
(
regex_custom_links
,
(
match_info
,
value
)
=>
{
string
group
=
match_info
.
fetch
(
1
);
debug
(
"found custom-link group: %s"
,
group
);
...
...
libgitg/gitg-textconv.vala
View file @
7f8203f2
...
...
@@ -32,7 +32,11 @@ public class TextConv
{
string
?
command
=
null
;
var
path
=
file
.
get_path
();
var
diffattr
=
repository
.
get_attribute
(
path
,
"diff"
,
Ggit
.
AttributeCheckFlags
.
FILE_THEN_INDEX
);
string
?
diffattr
=
null
;
try
{
diffattr
=
repository
.
get_attribute
(
path
,
"diff"
,
Ggit
.
AttributeCheckFlags
.
FILE_THEN_INDEX
);
}
catch
{}
if
(
diffattr
!=
null
)
{
var
textconv_key
=
"diff.%s.textconv"
.
printf
(
diffattr
);
...
...
@@ -55,11 +59,13 @@ public class TextConv
var
oid
=
file
.
get_oid
();
uint8
[]?
raw_content
=
null
;
if
(!
oid
.
is_zero
())
{
var
blob
=
repository
.
lookup
<
Ggit
.
Blob
>(
oid
);
raw_content
=
blob
.
get_raw_content
();
try
{
var
blob
=
repository
.
lookup
<
Ggit
.
Blob
>(
oid
);
raw_content
=
blob
.
get_raw_content
();
content
=
get_textconv_content_from_raw
(
repository
,
file
,
raw_content
);
}
catch
{}
}
content
=
get_textconv_content_from_raw
(
repository
,
file
,
raw_content
);
}
return
content
;
}
...
...
@@ -80,23 +86,26 @@ public class TextConv
private
static
uint8
[]
textconv
(
string
command
,
uint8
[]?
data
)
{
var
subproc
=
new
Subprocess
(
STDIN_PIPE
|
STDOUT_PIPE
,
command
,
"/dev/stdin"
);
string
lines
=
""
;
try
{
var
subproc
=
new
Subprocess
(
STDIN_PIPE
|
STDOUT_PIPE
,
command
,
"/dev/stdin"
);
var
input
=
new
MemoryInputStream
.
from_data
(
data
,
GLib
.
free
);
var
input
=
new
MemoryInputStream
.
from_data
(
data
,
GLib
.
free
);
subproc
.
get_stdin_pipe
().
splice
(
input
,
CLOSE_TARGET
);
var
end_pipe
=
subproc
.
get_stdout_pipe
();
var
output
=
new
DataInputStream
(
end_pipe
);
subproc
.
get_stdin_pipe
().
splice
(
input
,
CLOSE_TARGET
);
var
end_pipe
=
subproc
.
get_stdout_pipe
();
var
output
=
new
DataInputStream
(
end_pipe
);
string
line
s
=
""
;
string
?
line
=
null
;
do
{
line
=
output
.
read_line
();
if
(
line
!
=
null
)
{
line
=
line
.
replace
(
"\f"
,
""
)
;
lines
+=
line
+
"\n"
;
}
}
while
(
line
!=
null
);
string
?
line
=
null
;
do
{
line
=
output
.
read_line
();
if
(
line
!
=
null
)
{
line
=
line
.
replace
(
"\f"
,
""
);
line
s
+
=
line
+
"\n"
;
}
}
while
(
line
!=
null
);
}
catch
{}
return
lines
.
data
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment