# Patch (Re: t1300-repo-config.sh failed on CYGWIN)

2 messages from 2006-12-20 to 2006-12-20. Participants: SungHyun Nam.
Thread: https://gitlist.dev/t/43719

## SungHyun Nam, 2006-12-20 02:37

Subject: t1300-repo-config.sh failed on CYGWIN
Message-ID: <4588A1EC.7040301@gmail.com>
URL: https://gitlist.dev/e/4588A1EC.7040301%40gmail.com

```
If I run it on CYGWIN, there's an error msg:

* FAIL 39: rename section
        git-repo-config --rename-section branch.eins branch.zwei
* FAIL 40: rename succeeded
        diff -u expect .git/config
...

I run some commands...

$ cd t/trash
$ rm -f .git/config.lock
$ ../../git-repo-config.exe --rename-section branch.eins branch.zwei
error: Cannot commit config file!

Thanks,
namsh




```

## SungHyun Nam, 2006-12-20 03:22

Subject: Patch (Re: t1300-repo-config.sh failed on CYGWIN)
Message-ID: <emaa94$qn4$1@sea.gmane.org>
URL: https://gitlist.dev/e/emaa94%24qn4%241%40sea.gmane.org
In-Reply-To: <4588A1EC.7040301@gmail.com>

```
SungHyun Nam wrote:
> If I run it on CYGWIN, there's an error msg:
>
> * FAIL 39: rename section
>         git-repo-config --rename-section branch.eins branch.zwei
> * FAIL 40: rename succeeded
>         diff -u expect .git/config

With a patch below, the problem gone.

BTW, there's a leak for 'config_filename' in
git_config_rename_section().

Thanks,
namsh

diff --git a/config.c b/config.c
index 663993f..a23ac47 100644
--- a/config.c
+++ b/config.c
@@ -806,6 +806,7 @@ int git_config_rename_section(const char *old_name,
const char *new_name)
 		}
 		write(out_fd, buf, strlen(buf));
 	}
+	fclose(config_file);
 	if (close(out_fd) || commit_lock_file(lock) < 0)
 		return error("Cannot commit config file!");
 	return ret;

```
