Skip to content

Commit

Permalink
Merge pull request #99 from HarithaIBM/patchFailFix
Browse files Browse the repository at this point in the history
2.42.1 patch issue fixes
  • Loading branch information
HarithaIBM authored Nov 10, 2023
2 parents 69500a0 + ab52a8f commit 7c7f7e1
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 71 deletions.
2 changes: 1 addition & 1 deletion buildenv
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export ZOPEN_BUILD_LINE="STABLE"

# bump: git-version /GIT_VERSION="(.*)"/ https://github.com/git/git.git|*
GIT_VERSION="2.41.0"
GIT_VERSION="2.42.1"

export ZOPEN_DEV_URL="https://github.com/git/git"
export ZOPEN_DEV_DEPS="curl git make m4 perl autoconf automake help2man texinfo xz zlib openssl expat gettext coreutils diffutils bash"
Expand Down
36 changes: 0 additions & 36 deletions stable-patches/cache.h.patch

This file was deleted.

24 changes: 13 additions & 11 deletions stable-patches/config.c.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
diff --git a/config.c b/config.c
index b79baf8..57fe8b4 100644
index 3846a37..4cb3e7c 100644
--- a/config.c
+++ b/config.c
@@ -11,6 +11,7 @@
#include "alloc.h"
#include "date.h"
#include "branch.h"
+#include "cache.h"
#include "config.h"
#include "convert.h"
#include "environment.h"
@@ -1708,6 +1709,13 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
@@ -39,6 +39,9 @@
#include "worktree.h"
#include "ws.h"
#include "write-or-die.h"
+#ifdef __MVS__
+#include "read-cache-ll.h"
+#endif

struct config_source {
struct config_source *prev;
@@ -1670,6 +1673,13 @@ static int git_default_core_config(const char *var, const char *value,
return 0;
}

+#ifdef __MVS__
+ #ifdef __MVS__
+ if (!strcmp(var, "core.ignorefiletags")) {
+ ignore_file_tags = git_config_bool(var, value);
+ return 0;
Expand Down
39 changes: 16 additions & 23 deletions stable-patches/object-file.c.patch
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
diff --git a/object-file.c b/object-file.c
index 7c1af5c..ed4494d 100644
index 7dc0c4b..02ee8bd 100644
--- a/object-file.c
+++ b/object-file.c
@@ -9,6 +9,7 @@
#include "git-compat-util.h"
#include "abspath.h"
#include "alloc.h"
+#include "cache.h"
#include "config.h"
#include "convert.h"
#include "environment.h"
@@ -44,6 +45,10 @@
@@ -44,6 +44,11 @@
#include "submodule.h"
#include "fsck.h"
#include "wrapper.h"
+

+#ifdef __MVS__
+#include <_Ccsid.h>
+#include "read-cache-ll.h"
+#endif
+
/* The maximum size for an object header. */
#define MAX_HEADER_LEN 32
@@ -2479,18 +2484,87 @@ int index_fd(struct index_state *istate, struct object_id *oid,

@@ -2478,18 +2483,87 @@ int index_fd(struct index_state *istate, struct object_id *oid,
return ret;
}

+#ifdef __MVS__
+void validate_codeset(struct index_state *istate, const char *path, int* autoconvertToASCII) {
+ struct conv_attrs ca;
+ struct conv_attrs ca;
+ struct stat st;
+ unsigned short attr_ccsid;
+ unsigned short file_ccsid;
Expand All @@ -36,7 +29,7 @@ index 7c1af5c..ed4494d 100644
+ return;
+
+ *autoconvertToASCII = 0;
+ convert_attrs(istate, &ca, path);
+ convert_attrs(istate, &ca, path);
+ if (ca.attr_action == CRLF_BINARY) {
+ attr_ccsid = FT_BINARY;
+ }
Expand All @@ -57,7 +50,7 @@ index 7c1af5c..ed4494d 100644
+
+ if (attr_ccsid != file_ccsid) {
+ if (file_ccsid == 1047 && attr_ccsid == 819) {
+ *autoconvertToASCII = 1;
+autoconvertToASCII = 1;
+ return;
+ }
+ // Allow tag mixing of 819 and 1208
Expand All @@ -68,19 +61,19 @@ index 7c1af5c..ed4494d 100644
+ if (attr_ccsid == FT_BINARY)
+ return;
+
+ char attr_csname[_XOPEN_PATH_MAX] = {0};
+ char attr_csname[_XOPEN_PATH_MAX] = {0};
+ char file_csname[_XOPEN_PATH_MAX] = {0};
+ if (attr_ccsid != FT_BINARY) {
+ __toCSName(attr_ccsid, attr_csname);
+ } else {
+ } else {
+ snprintf(attr_csname, _XOPEN_PATH_MAX, "%s", "binary");
+ }
+ if (file_ccsid != FT_BINARY) {
+ __toCSName(file_ccsid, file_csname);
+ } else {
+ } else {
+ snprintf(file_csname, _XOPEN_PATH_MAX, "%s", "binary");
+ }
+ die("%s added file: file tag (%s) does not match working-tree-encoding (%s)", path, file_csname, attr_csname);
+ die("%s added file: file tag (%s) does not match working-tree-encoding (%s)", path, file_csname, attr_csname);
+ }
+}
+#endif
Expand All @@ -91,8 +84,8 @@ index 7c1af5c..ed4494d 100644
int fd;
struct strbuf sb = STRBUF_INIT;
int rc = 0;
+ struct conv_attrs ca;
+ int autocvtToASCII;
+ struct conv_attrs ca;
+ int autocvtToASCII;

switch (st->st_mode & S_IFMT) {
case S_IFREG:
Expand Down
15 changes: 15 additions & 0 deletions stable-patches/read-cache-ll.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/read-cache-ll.h b/read-cache-ll.h
index 9a1a7ed..a99eef7 100644
--- a/read-cache-ll.h
+++ b/read-cache-ll.h
@@ -466,6 +466,10 @@ struct cache_entry *refresh_cache_entry(struct index_state *, struct cache_entry

void set_alternate_index_output(const char *);

+#ifdef __MVS__
+extern int ignore_file_tags;
+#endif
+
extern int verify_index_checksum;
extern int verify_ce_order;

0 comments on commit 7c7f7e1

Please sign in to comment.