Skip to content

Commit b25ea22

Browse files
committed
Updating tests and unpack-tress.c [GSOC]
While submitting my previous commit found that previous testcases weren't working properly with my updates So fixed the test updates and advice conflict issue. Signed-off-by: Arsh Srivastava <arshsrivastava00@gmail.com>
1 parent 4237b96 commit b25ea22

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

t/t6439-merge-co-error-msgs.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ error: Your local changes to the following files would be overwritten by checkou
7777
rep/one
7878
rep/two
7979
Please commit your changes or stash them before you switch branches.
80+
Try using 'git checkout -m <branch>' for a quick fix.
81+
Please Note :- that using -m (merge) will not save your changes, rather would directly merge them. Meaning if you are not able to resolve conflicts and does --hard reset your local changes would be gone.
8082
Aborting
8183
EOF
8284

@@ -99,6 +101,8 @@ error: Your local changes to the following files would be overwritten by checkou
99101
rep/one
100102
rep/two
101103
Please commit your changes or stash them before you switch branches.
104+
Try using 'git checkout -m <branch>' for a quick fix.
105+
Please Note :- that using -m (merge) will not save your changes, rather would directly merge them. Meaning if you are not able to resolve conflicts and does --hard reset your local changes would be gone.
102106
Aborting
103107
EOF
104108

t/t7406-submodule-update.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ test_expect_success 'submodule update should fail due to local changes' '
212212
> error: Your local changes to the following files would be overwritten by checkout:
213213
> file
214214
> Please commit your changes or stash them before you switch branches.
215+
> Try using '\''git checkout -m <branch>'\'' for a quick fix.
216+
> Please Note :- that using -m (merge) will not save your changes, rather would directly merge them. Meaning if you are not able to resolve conflicts and does --hard reset your local changes would be gone.
215217
> Aborting
216218
> fatal: Unable to checkout OID in submodule path '\''submodule'\''
217219
EOF

unpack-trees.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
134134
"Meaning if you are not able to resolve conflicts and does --hard reset your local changes would be gone."
135135
)
136136
: _("Your local changes to the following files would be overwritten by checkout:\n%%s"
137-
"Please commit your changes or stash them before you switch branches.\n"
138-
"Try using 'git checkout -m <branch>' for a quick fix.\n"
139-
"Please Note :- that using -m (merge) will not save your changes, rather would directly merge them.\n"
140-
"Meaning if you are not able to resolve conflicts and does --hard reset your local changes would be gone."
141-
);
137+
"Please commit your changes or stash them before you switch branches.");
142138
else if (!strcmp(cmd, "merge"))
143139
msg = advice_enabled(ADVICE_COMMIT_BEFORE_MERGE)
144140
? _("Your local changes to the following files would be overwritten by merge:\n%%s"

0 commit comments

Comments
 (0)