FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
php-git/example/diff.php at develop · libgit2/php-git · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
libgit2
/
php-git
Public
Notifications
You must be signed in to change notification settings
Fork
76
Star
566
Code
Issues
31
Pull requests
5
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
php-git
/
example
/
diff.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
12 lines (11 loc) · 457 Bytes
Breadcrumbs
php-git
/
example
/
diff.php
Copy path
File metadata and controls
12 lines (11 loc) · 457 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
<?php
$
repo
=
git_repository_open
(
"
.
"
);
$
tree
=
git_tree_lookup
(
$
repo
,
"
e14ccb8e18d632d78ce2f0aeb06597a03f42b237
"
);
$
diff
=
git_diff_tree_to_workdir
(
$
repo
,
$
tree
,
git_diff_options_init
());
$
p
=
array
();
git_diff_print
(
$
diff
,
GIT_DIFF_FORMAT_PATCH
,
function
(
$
diff_delta
,
$
diff_hunk
,
$
diff_line
,
$
payload
){
if
(
$
diff_line
[
'
origin
'
] ==
"
-
"
||
$
diff_line
[
'
origin
'
] ==
"
+
"
) {
echo
$
diff_line
[
'
origin
'
];
}
echo
$
diff_line
[
'
content
'
];
},
$
p
);
Back
|
FazBrowse Home
|
New Git URL